3

I'm new to ubuntu and I am trying to use the functionality of the Files application to add a server to my file locations but it must be accessed through another server.

I was able to connect to server A (blacked out for privacy) using ssh://[email protected] in the Connect to Server section outlined in red below. I would like to connect to server B through server A. Is this possible here or can I only do it via a terminal? It would make copying files over a bit easier.

enter image description here

2 Answers 2

2

You could add the following to ~/.ssh/config on your Ubuntu machine:

 Host serverB-proxied
   Hostname serverB  # the real hostname of serverB
   User username     # this is the username on serverB
   ProxyCommand ssh -W %h:%p user@serverA

Then use this as the URL in Files:

ssh://serverB-proxied/

(It will only work if the sshd on serverA does not have TCP forwarding disabled.)

1

A way would be to use port forwarding, which would involve some use of terminal. If you create a tunnel via ServerA to ServerB like this:

ssh -L 127.0.0.1:222:ServerB:22 user@ServerA

Explanation: ssh creates a local port 222 (you may change this to which ever port that is not in use on your local host) - and binds it to 127.0.0.1 only - that forwards all traffic from localhost:222 via ServerA to port 22 on ServerB after you have logged on ServerA.

After that you connect the Files app to ssh://user@localhost:222

This could be set up as a startup script with ssh keys for seamless re-connections.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .