November 14, 2010 by  

Beginners Guide: Copy Your Files To Remote Server With scp

When you are moving your website to another server or maybe copying a file to a remote host, there are lot ways to do that. One of them is using “scp” or secure copy. scp is used for copying file from local to remote host securely. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Copy a file from a remote host to the local host:

scp username@remotehost.com:file.txt /path/local/directory

Copy a file from the local host to a remote host:

scp /path/local/directory  username@remotehost.com:file.txt

Copy a directory from local host to a remote host

scp -r /path/local/directory username@remotehost.com:/path/remote/directory

Copy a directory from remote host to a local host

scp -r username@remotehost.com:/path/remote/directory /path/local/directory

Copy a file from remote host 1 to remote host 2 (copy file between remote host)

scp username@remotehost1.com:/path/remote/host1/file.txt username@remotehost2.com:/path/remote/host2/

Use blowfish cipher to encrypt the data being sent:

scp -c blowfish /path/local/directory  username@remotehost.com:file.txt

Compress the file before send:

scp -c blowfish -C /path/local/directory  username@remotehost.com:file.txt

What people search:

Post comment as twitter logo facebook logo
Sort: Newest | Oldest