0

I have a text file on the server (Linux) at work and now I am at home. I am a PuTTY user. To connect to the server from home I have to connect to another server and then by SSH to the main server (which means I can connect to the server at work, indirectly from home) so I can't use scp command or WinSCP to transfer or copy my file to my computer at home. Does anybody know that how I can transfer or copy my file from the server at work to my home computer (Windows system)?

1
  • 2
    Can you set up a port forward to the main server using PuTTy? If so, you could start a direct connection with the server (through the port forward) and use SCP to copy the files.
    – hololeap
    Dec 25, 2014 at 1:15

3 Answers 3

1

You could always transfer files to the intermediate server and then copy it from there. However if the intermediate server has space limitations and cannot hold large files, then you need to create a tunnel through the intermediate server to the second server.

Creating a tunnel through putty,

1) your ssh config should point the intermediate server like this:

Putty connect to intermediate server

2) Then go to Connection -> ssh -> tunnels, you can use any port on your pc for source port, I've entered 8080 here, and in the destination enter the company server which is accessible through the intermediate server as companyServer:22 and hit add.

ssh tunnel config

3) Hit open, it should ask you the credentials for your intermediate server. Once this is done, you can open your scp client like winscp and point it to at port 8080. This connection will be forwarded to your company server's port 22, where the sshd will be running.

1

You are looking for SSH tunneling (as other answers pointed out).

Note that WinSCP supports a (one hop) tunneling natively, so you do not need to bother with setting up a tunnel in PuTTY.

See the Tunnel page on WinSCP Advanced Site Settings dialog.

Tunnel page

0

If I understand your scenario right, you are saying that you have to connect to one computer via SSH, and then connect to another computer from there?

If so, why not log in to the first server, and then run scp mainserver:file.txt ./. Then log out, and run scp firstserver:file.txt ./ to get it from the first server. You can then log in to the first server and delete the file.

You must log in to answer this question.

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