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 
3
  • Please post the output of ssh-add -l Commented Aug 16, 2021 at 22:17
  • @Ginnungagap, sure. Done. Commented Aug 17, 2021 at 0:04
  • You shouldn't copy your private key to other hosts. In this scenario, use a separate deploy key for git operations. Commented Aug 21, 2021 at 18:02

1 Answer 1

0

Ok, it's work:

On local machine:

ssh-add ~/.ssh/id_rsa.dev 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.