I am doing multi-hop ssh using keys. I am doing an ssh to server2, via server1.
From the command line the following works well:
Code:
ssh -t www.server1.com ssh -t www.server2.com
This takes me straight through to server2 without any passwords as expected.
I would like to do the same thing but using the .ssh/config file
The relevant parts of my config file are:
Code:
Host server1
HostName www.server1.com
User steve
Host server2
HostName www.server2.com
ProxyCommand ssh steve@www.server1.com nc %h %p
User steve
Now when I try from the command line:
This takes me onto server1 without passwords
This takes me to server2. However it is asking me for a password on server2.
Appreciate any clarification as to the correct form of the ProxyCommand (or other switches
in the config file) that will enable the multi-hop ssh to server2, using keys.