Professional Documents
Culture Documents
SCP (Secure CoPy) is a remote file copy program, that copies files between hosts on a network.
It uses SSH for data transfer, and uses the same authentication and provides the same security as SSH.
When copying a source file to a target file which already exists, SCP will replace the contents of the target file. If the target file does not yet exist, an
empty file with the target file name is created, then filled with the source file contents.
Example 1: Copy the file file.txt from a remote host to the local host.
Example 2: Copy the file file.txt from the local host to a remote host.
Example 3: Copy the directory dir1 from the local host to a remote hosts directory dir2.
Example 4: Copy the file file.txt from remote host remote.host1 to remote host remote.host2.
Example 5: Copy the files file1.txt and file2.txt from the local host to your home directory on the remote host.
Example 6: Copy the file file.txt from the local host to a remote host using port 2222.
Example 7: Copy the file file.txt from the local host to a remote hosts home directory. Preserve the modification and access times, as well as the
permissions of the source-file in the destination-file.
Example 8: Copy the file file.txt from the local host to a remote hosts home directory. Increase SCP speed by changing the cipher from the
default AES-128 to Blowfish.
Example 9: Copy the file file.txt from the local host to a remote hosts home directory. limit the bandwidth used by SCP command to 100 Kbit/s.
Example 10: Copy multiple files from the remote host to your current directory on the local host.
$ scp user@remote.host:~/\{file1,file2,file3\} .