dotancohen
dotancohen

Reputation: 31481

Transferring file to local machine when SSHing into a foreign box

One can log into a remote shell via SSH, and one can use an FTP application to log in via SFTP using the same credentials over SSH. How then, does one initiate a file transfer from the remote host to the local host when logged into a shell via SSH?

I know that I could use scp or rsync to move the files, but the requires authenticating which is not something that I can always do from the host. From my limited understanding the existing SSH connection is all that should be needed, as SSH has file transfer capability.

Thanks.

Upvotes: 2

Views: 609

Answers (1)

TaoJoannes
TaoJoannes

Reputation: 594

So from local host A, you log in to remote host B, and want to transfer a file from B back to A?

You need a server of some sort on A to handle the request, or pull it from B when you're logged in to A.

Is it possible to set up authorized_keys on the servers to facilitate password-free authentication?

EDIT: On *nix hosts, you can get the package zssh on A and lrzsz on B. Then instead of ssh B you run zssh B, cd to the directory you want to get a file from, run sz file.name then hit ctrl+space and enter rz, and it will transfer locally. Other clients may have other methods.

Upvotes: 1

Related Questions