Transferring files from Ubuntu via inner server (ssh-> ssh) with FileZilla

-1

2

Currently, I can access a server called opt2 with two ssh (I can't access this server directly). It goes like this in terminal. Each ssh has me enter a different password:

ssh username@athena.ecs.csus.edu 

Then I ssh again:

ssh user2@opt2

I can run scripts and such via terminal this way. What I need to do is open/edit/download files efficiently with my Ubuntu OS using something like FileZilla. I can't get WinSCP on Ubuntu. I'm willing to try anything available for Ubuntu. I tried this in terminal:

ssh -L 4444:opt2:22 myUserName@athena.ecs.csus.edu 

(can someone explain this command if it's relevant?)

This command connects me to athena and seems to open a port or tunnel. I'm not sure what to do from there.

What I'm looking for is a couple terminal commands that will create a proxy folder, port, or gateway or something like that, that will allow FileZilla to access opt2 from my Ununtu PC through athena. I also need to know how use fileZilla to access that [gateway] once it's opened.

My colleges do a similar thing on Windows with WinSCP, but don't know how to on Ubuntu. If FileZilla doesn't work for this then please recommend another application that will work.

I need to retrieve these files for a school project. Am very basic so any help is greatly appreciated. Thank you.

HippoMano

Posted 2018-10-12T17:28:11.657

Reputation: 13

Answers

0

This question contains more than one layer:

  • There is no need for a WinSCP-like program on Ubuntu, as the functionality is integrated in the OS (and the GUI). The details vary from version to version, but either "Connect to server" or the Ctl-L shortcut will help you
  • ssh allows you not only to connect to a server, but also to forward a connection from the an endpoint on the initiating side to an endpoint that is reachable from the server side.

Now let's put it all together: On your Ubuntu workstation, you run from a terminal: ssh -L 127.0.0.1:4444:opt2:22 myUserName@athena.ecs.csus.edu - this will create an SSH connection to your gateway server and instruct it to forward port 4444 on your Workstation to port 22 (the SSH port) on opt2. This means, that if you were to ssh on your Workstation to port 4444 you would instead SSH to opt2.

Leaving this connection in place, you could now connect to sftp://user2@127.0.0.1:4444 (via "connect to server" or ctl-L) and you will see a Nautilus File Manager window directly into your target server. All typical programs can now access those files, i.e. you can directly edit any text files.

Eugen Rieck

Posted 2018-10-12T17:28:11.657

Reputation: 15 128

0

I tried this in terminal:

ssh -L 4444:opt2:22 myUserName@athena.ecs.csus.edu 

(can someone explain this command if it's relevant?)

This command connects me to athena and seems to open a port or tunnel. I'm not sure what to do from there.

The command opens a local local port 4444 and tunnels it to opt2:22 via athena. If you connect to local port 4444, it's as if you have connected to opt2:22

So, now that you have a tunnel opened, you can connect with FileZilla to it.

In your favorite SSH/SFTP client, specify localhost as a hostname and 4444 as a port number. Credentials are the same as if you were connecting to the target machine directly.

Martin Prikryl

Posted 2018-10-12T17:28:11.657

Reputation: 13 764