Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Problem: to get the cammond "scp file user@server:" (source) work vice versa. I need a server on my local machine so I can copy files to-and-fro like:

ROOT+SERVER+FILE      <----    Commands?    --->     FILE+LOCAL+YOUR+COMP
                               scp? how?             turn it to a server?

I want to use the command:

scp user@server:file me@my_local_server_on_my_comp:
share|improve this question
You don't need an sshd server running to scp a file from a remote system. I strongly suggest reading 'man scp' and 'man ssh' on your system so you understand these commands. – jtimberman Jul 29 '09 at 17:44
up vote 3 down vote accepted

The second argument is the "destination," which can be a server and a path, or just a path.

scp file user@server:newfile will copy "file" to the server as "newfile"

scp user@server:file newfile will copy "file" from the server as "newfile" <-- This is what you are looking for.

scp user@server1:file user@server2:newfile will copy "file" from server1 to server2 as "newfile"

share|improve this answer
He doesn't have to specify a name for the file on his local machine. 'scp user@server:file . ' will copy the file to the current working directory. – Richard Hoskins Jul 29 '09 at 17:53

You can copy a remote file from the server to your local machine with,

localmachine prompt> scp user@server:/path/to/file /local/path/
  • This assumes you have a user named login on the server,
  • It will ask you for password to user on server if you do not have public key authentication setup.
  • It will copy the remote file to your local disk at /local/path
  • It will get the file from the absolute path /path/to/ on the server
share|improve this answer

You must log in to answer this question.