Homeserver for the command "scp user@server:file localhost@server:mycomp/"?

3

1

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:

user3672

Posted 2009-07-29T17:37:10.080

Reputation:

5You 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 – 2009-07-29T17:44:21.423

Answers

3

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"

ACoolie

Posted 2009-07-29T17:37:10.080

Reputation: 761

1He 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 – 2009-07-29T17:53:39.313

2

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

nik

Posted 2009-07-29T17:37:10.080

Reputation: 50 788