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.

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
4  
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

2 Answers 2

up vote 2 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
1  
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

Your Answer

 
discard

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