Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sometimes at work I need to ssh into a local server on the command line to do some handiwork. A couple of times I've needed to copy a file onto my local machine. I can do this with the cp command locally or on a server, but is there any easy way I can do this from the server to my local machine?

share|improve this question
add comment

4 Answers

To copy files between Linux boxes using scp do (from the server):

scp local.txt user@remote.server:/foo/bar

to copy a local file to the remote directory /foo/bar.

To copy a file from the remote server to your local $HOME (from your local machine) do:

scp user@remote.server:/foo/bar/remote.txt ~/local_name.txt

If for some reason scp is not present in your machine (which is probably impossible if you have ssh installed) install the openssh package. For debian based distributions, do this:

sudo apt-get install openssh
share|improve this answer
add comment

In addition to WinSCP, FileZilla is also a great tool.

share|improve this answer
    
The OP is using linux. –  terdon Feb 1 '13 at 10:46
add comment

scp will copy files between 2 computers. sshd needs to be running on the remote system. if your local system is running under Windows - WinSCP is a great Windows client.

share|improve this answer
add comment

I don't believe you can [easily]. To do this between Linux boxes is trivial - you just use SCP (in much the same way as you use CP), but as you are not running an ssh daemon on your Windows desktop that won't work to well.

You should be able to pull files from the server onto your Windows box using something like WinSCP though.

Alternatively (and don't use windows so can't test it) you might be able to get away with running something like something like freeSSHd (which I found by googling, never used it) and then using SCP in much the same way as you would Linux -> Linux. See http://www.techrepublic.com/blog/itdojo/set-up-a-free-ssh-server-on-windows-7-with-freesshd/3506

share|improve this answer
    
Actually, I have a Linux box at work –  symlink Feb 1 '13 at 5:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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