Cannot SSH/SFTP to remote server without using another remote server
I can access a server A with SSH, and from there I can access server B, but I can't access B directly.
Is it possible to open a Nautilus folder in server B by clicking in Places
→ Connect to Server
?
Yes that is possible. I have the following setup which works, but there might be easier ones.
In the file ~/.ssh/config
, add the following lines:
ControlMaster auto
ControlPath /home/yourusername/.ssh/tmp/%h_%p_%r
Host A
HostName hostname.of.server.a
Host B
ProxyCommand ssh -e none A netcat -w 5 hostname.of.server.b 22
You have to replace yourusername, hostname.of.sever.a and hostname.of.server.b
After that, you can (in Nautilus) go to Places->Connect to Server (its actually File->Connect to Server on my machine). And then enter B
.
That should be all to see the server B.
One thing to try is to add this to .ssh/config:
Host B
ProxyCommand ssh A nc -q0 %h %p
ForwardAgent yes
Once this is in place, you should be able to ssh B
directly, and SSH will know to "bounce" the connection through A first.
When this is working, try Nautilus the way you describe and see if the proxying setup works for it as well.