0

I'm using ansible and i'm wondering. Is it possible to rewrite a local ssh key to a remote machine? I need to clone a repository using my private key on a remote machine. I cannot add the key from the machine in this case )this key will vary depending on who is starting the playbook)

I try:

~/.ssh/config
Host app01.dev.d
  User root
  ForwardAgent yes
  IdentityFile ~/.ssh/id_rsa.dev
  ProxyCommand ssh -W %h:%p acd

The proxy is working fine.

~/.ssh/id_rsa.dev and ~/.ssh/id_rsa is added to gitlab in ssh keys

On remote machine:


ssh-add -l
The agent has no identities
onev
  • 1
  • 1

1 Answers1

0

Ok, it's work:

On local machine:

ssh-add ~/.ssh/id_rsa.dev
onev
  • 1
  • 1