Is there a convenient method to pull files from a server in an SSH session?

Posted by tel on Super User See other posts from Super User or by tel
Published on 2011-02-12T19:49:50Z Indexed on 2011/02/13 15:27 UTC
Read the original article Hit count: 187

Filed under:
|
|

I often SSH into a cluster node for work and after processing want to pull several results back to my local machine for analysis. Typically, to do this I use a local shell to scp from the server, but this requires a lot of path manipulation. I'd prefer to use a syntax like interactive FTP and just 'pull' files from the server to my local pwd.

Another possible solution might be to have some way to automatically set up my client computer as an ssh alias so that something like

scp results home:~/results

would work as expected.

Is there any obscure SSH trick that'll do this for me?


Working from grawity's answer, a complete solution in config files is something like

local .ssh/config:

Host ex
    HostName ssh.example.com
    RemoteForward 10101 localhost:22

ssh.example.com .ssh/config:

Host home
    HostName localhost
    Port 10101

which lets me do commands exactly like

scp results home:

transferring the file results to my home machine.

© Super User or respective owner

Related posts about ssh

Related posts about file-transfer