SSH ForwardAgent + multi-Host
I have several Hosts in ~/.ssh/config, and they work fine from local
machine, but remote machine always uses the first one.
Host A
HostName github.com
IdentityFile ~/.ssh/A_rsa
Host B
HostName github.com
IdentityFile ~/.ssh/B_rsa
Host remotemachine.com
ForwardAgent yes
From localhost:
$ ssh -T git@A
Hi A! You've successfully authenticated, ...
$ ssh -T git@B
Hi B! You've successfully authenticated, ...
From remote host:
$ ssh remotemachine
$ ssh-add -l
... both keys present ...
$ ssh -T git@B
ssh: Could not resolve hostname B: Name or service not known
$ ssh -T git@github.com
Hi A! You've successfully authenticated, ...
How to use key B on remote machine?
No comments:
Post a Comment