1

For research purposes, I use the University server.

The server login is a two-step process.

First, I type

ssh -p 44  [email protected]

(Altered for security reason)

Then the password is prompted. I type the credential

Then I type

ssh [email protected]

Then the password is prompted. I type the credential

Now if I have to transfer a file (say a pdf file namely first.pdf) to the working directory I use the following code

scp - P 44 first.pdf [email protected]:~/

scp first.pdf [email protected]:~/

Until here it is clear My doubt begins after this

  1. If I have to bring back the first.pdf from the final working directory to the local machine. (working computer).

How to do it?

  1. I was able to access the intermediate directory ([email protected]:~/) through Filezilla. But I was not able to access the final main directory through Filezilla. I tried through other software such as winscp neither it worked. The GUI software generally has a single tab for typing username and password. But here I have 2 step login process. Hence the whole confusion.

How to access the final working directory through a GUI software.

1

2 Answers 2

2

rsync command can help you with:

rsync -av -e "ssh -p 44 [email protected]" [email protected]:~/first.pdf ./

The server [email protected] will be used as a proxy to reach the file on remote host. The file first.pdf will be copied on your local machine.

6
  • 1
    Are you sure about your command's syntax? I get an error (too long for reporting it here in a comment), while rsync -av -e "ssh -J [email protected]:44 [email protected]" :~/first.pdf ./ works. Also, I think the "proxy" in the question would be [email protected].
    – fra-san
    Commented Aug 29, 2020 at 21:43
  • @maruscya I got the following error code on using your codes rsync: connection unexpectedly closed (0 bytes received so far) [Receiver] rsync error: remote command not found (code 127) at io.c(235) [Receiver=3.1.2] Commented Aug 30, 2020 at 3:57
  • @fra-san please post your comment as an answer. It really worked great. I was not able to find the answer easily in any forum, so it would be greatly beneficial to have it as an accepted answer. Commented Aug 30, 2020 at 4:02
  • @fra-san is there a way to access the same folder using a GUI Commented Aug 30, 2020 at 4:09
  • 1
    @PraveenKumar-M I'm not fond of posting answers differing from existing answers on syntax details only. Better to have the existing answers improved ;-) Here, it should be enough to just change -p 44 [email protected] to -J [email protected]:44. Note that --debug=CMD (if your version of rsync supports it) is very handy to debug command line errors.
    – fra-san
    Commented Aug 30, 2020 at 10:17
1

WinSCP actually supports connecting via an SSH jump server.

Just specify connection data for your intermediate server on the Tunnel page of the advanced site settings.

See also WinSCP guide for Connecting to FTP/SFTP server which can be accessed via another server only.


For Linux command-line solutions, see:
How can I download a file from a host I can only SSH to through another host?

1
  • 1
    WinSCP worked absolutely abliss. Commented Aug 30, 2020 at 10:40

You must log in to answer this question.

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