Tim Spriggs
2016-03-11 21:30:33 UTC
Hi OpenSSH peeps!
I have looked around a few man pages and the usual sources of
information but I can't seem to find a way to only forward specific
identities to some hosts. What I would really like to have is a way to
only forward the identity that gave me a successful auth:
% ls ~/.ssh | grep .pub
id_ecdsa.pub
id_ed25519.pub
id_rsa.pub
% cat .ssh/config
Host example.com:
IdentitiesOnly=yes
IdentityFile=/home/tspriggs/.ssh/id_rsa.pub
Host another-example.com:
IdentitiesOnly=yes
IdentityFile=/home/tspriggs/.ssh/id_ecdsa.pub
# This would be super cool:
Host *
OnlyForwardAuthedKey=yes
% ssh ***@example.com
example.com % ssh-agent -L
ssh-rsa ...
example.com % ssh ***@another-example.com
Permission denied (publickey)
example.com % logout
Connection to example.com closed.
% ssh ***@another-example.com
another-example.com % ...
Cheers,
-Tim
I have looked around a few man pages and the usual sources of
information but I can't seem to find a way to only forward specific
identities to some hosts. What I would really like to have is a way to
only forward the identity that gave me a successful auth:
% ls ~/.ssh | grep .pub
id_ecdsa.pub
id_ed25519.pub
id_rsa.pub
% cat .ssh/config
Host example.com:
IdentitiesOnly=yes
IdentityFile=/home/tspriggs/.ssh/id_rsa.pub
Host another-example.com:
IdentitiesOnly=yes
IdentityFile=/home/tspriggs/.ssh/id_ecdsa.pub
# This would be super cool:
Host *
OnlyForwardAuthedKey=yes
% ssh ***@example.com
example.com % ssh-agent -L
ssh-rsa ...
example.com % ssh ***@another-example.com
Permission denied (publickey)
example.com % logout
Connection to example.com closed.
% ssh ***@another-example.com
another-example.com % ...
Cheers,
-Tim