I am trying to put my multi-hop ssh command into the ssh .ssh/config file.
This is my connection graph: laptop (i am here) ——> userver ——-> workstation
I have put the ssh public rsa keys into 'userver' and 'workstation'. At this moment i can connect by typing this line:
ssh -A -t userserver@userver ssh -A userworkstation@workstation
I would like however, to be able to use the capabilities of the config file in ~/.ssh/config to reach the same effect but using one simple command, which would also allow me to do fast copy with 'scp'.
The only problem is that 'userver' does not have the "nc" command and i do not have superuser there, just control of my home folder. Nevertheless, i tried some things:
I've have this config file in my laptop (~/.ssh/config):
# laptop config file Host userver Hostname userver_hostname port 22 User server_user
Also another config file in the userver (~/.ssh/config)
# userver config file Host workstation Hostname workstation_hostname port 22 user workstation_username
With this config files i can connect as
ssh -A -t userver ssh -A workstation
which is an improvement, but not sufficient.
I tried adding another host in my laptops config, like this:
Host hop ProxyCommand ssh -A -t userver ssh -A workstation
Then, when i do
i get the following output with errors and cannot connect:
Pseudo-terminal will not be allocated because stdin is not a terminal. Pseudo-terminal will not be allocated because stdin is not a terminal. -bash: line 1: $'SSH-2.0-OpenSSH_6.4\r': command not found