Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

This question already has an answer here:

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).

share|improve this question

marked as duplicate by Gilles, jasonwryan, Patrick, slm, Warren Young Dec 15 '13 at 1:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

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

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.