I'm trying to tunnel to a server via a bridge server. So far, I've been able to get it working from the command shell properly using the following command:
ssh -A -t bridge_userid@bridgemachine.com ssh -A remote_userid@remoteserver.com
But I've been trying to wrap this into my ~/.ssh/config
file and I have troubles. I've tried:
Host axp
User remote_userid
HostName remoteserver.com
IdentityFile ~/.ssh/id_rsa.eric
ProxyCommand ssh -A -t bridge_userid@bridge_userid.com ssh -A remote_userid@%h
But when I do, I get the following error message from remoteserver.com
and I'm not sure what is causing it:
ksh: SSH-2.0-OpenSSH_6.8^M: not found
I know that when I log into remoteserver.com
, my shell is /usr/bin/ksh
.
I've tried to add path arguments to the ssh commands in the config file, but it made no difference.
Any ideas what it can be?
Best Answer
Jakuje's answer is right, but since OpenSSH
7.3
, you can now use-J
ProxyJump
which is easier. See my notes:OpenSSH
7.3
or aboveUse
ProxyJump
. As explained in the manual:ProxyJump
~/.ssh/config
example~/.ssh/config
Connect with
Add
-v
for verbose outputProxyJump
-J
Command line example~/.ssh/config
Connect with
Or use
-o
OpenSSH
5.4
or aboveUse
ProxyCommand
with-W
~/.ssh/config
Connect with
Or use
-o
OpenSSH bellow
5.4
~/.ssh/config
Connect with:
Or use
-o
Sources
-J
added in OpenSSH 7.3-W
added in OpenSSH 5.4