I have the following ssh connections:
user1@local --> root@machine1 --> root@machine2 --> abc@machine3
I need to be able to connect from local directly to machine3:
[user1@local]$ ssh abc@machine3
At this point I’m fine if I need to enter passwords, though ideally I would like to use ssh keys and no password connections.
I’m able to connect to machine1 and machine2 with sudo, but connecting to machine3 fails:
[user1@local]$ sudo ssh abc@machine3 root@machine1's password: root@machine2's password: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
My /root/.ssh/config file contains the following:
Host machine1 HostName machine1 User root IdentitiesOnly yes Host machine2 HostName machine2 User root ProxyCommand ssh -W %h:%p machine1 IdentitiesOnly yes Host machine3 HostName machine3 User abc ProxyCommand ssh -W %h:%p machine2 IdentitiesOnly yes
I’m on OpenSSH_5.3p1 on local machine, hence cannot use ProxyJump. Also there is no netcat support on machines 1,2 and 3.
When I ssh manually, I can only ssh to machine3 from machine2 as abc user and then there is no password required (authorized_keys set up on machine3). Connecting manually as any other user to machine3 from machine2 results in the same Permission denied error as above.
Any idea how to achieve the desired ssh connection from local machine? Is this doable?