Score:0

Forward local ssh key to remote host

jp flag

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
Ginnungagap avatar
gu flag
Please post the output of `ssh-add -l`
onev avatar
jp flag
@Ginnungagap, sure. Done.
Michael Hampton avatar
cz flag
You shouldn't copy your private key to other hosts. In this scenario, use a separate deploy key for git operations.
Score:0
jp flag

Ok, it's work:

On local machine:

ssh-add ~/.ssh/id_rsa.dev
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.