5

It often happens that I'm SSH'd into another machine and I'd like to download a file onto my local machine without having to open a new terminal and scp. For example, something like this:

local $ ssh remote
remote $ ls
remote_file
remote $ download remote_file
…
remote $ ^D
local $ ls
remote_file

Is there any way — even a terrible hack — to let me download a file while I'm SSH'd into the remote host, without using SCP?

I'd considered playing some tricks with, ex, $SSH_CLIENT, but that won't work when my local machine is behind a NAT (which is basically all the time).

1 Answers1

2

Instead of connecting to the remote machine using ssh use sftp. You will have a ftp client connect to the remote machine using the ssh protocol. When you'll be connect you'll be able to browse the remote machine using cd and ls. To copy the file in your local machine you'll use the get remote.file and the file will be copy to your local machine.

SFTP informations