Show pageOld revisionsBacklinksExport to PDFBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Copying Files over SSH ====== <code bash Copy the file “file.txt” from a remote host to the local host.>$ scp user@remote.host:file.txt /some/local/directory</code> <code bash Copy the file “file.txt” from the local host to a remote host.>$ scp file.txt user@remote.host:/some/remote/directory</code> <code bash Copy the directory “dir1” from the local host to a remote host’s directory “dir2”.>$ scp -r dir1 user@remote.host:/some/remote/directory/dir2</code> <code bash Copy the file “file.txt” from remote host “remote.host1” to remote host “remote.host2”.>$ scp user@remote.host1:/directory/file.txt user@remote.host2:/some/directory/</code> <code bash Copy the files “file1.txt” and “file2.txt” from the local host to your home directory on the remote host.>$ scp file1.txt file2.txt user@remote.host:~</code> <code bash Copy the file “file.txt” from the local host to a remote host using port 2222.>$ scp -P 2222 file.txt user@remote.host:/some/remote/directory</code> <code bash Copy the file “file.txt” from the local host to a remote host’s home directory. Preserve the modification and access times, as well as the permissions of the source-file in the destination-file.>$ scp -p file.txt user@remote.host:~</code> <code bash Copy the file “file.txt” from the local host to a remote host’s home directory. Increase SCP speed by changing the cipher from the default AES-128 to Blowfish.>$ scp -c blowfish file.txt user@remote.host:~</code> <code bash Copy the file “file.txt” from the local host to a remote host’s home directory. limit the bandwidth used by SCP command to 100 Kbit/s.>$ scp -l 100 file.txt user@remote.host:~</code> <code bash Copy multiple files from the remote host to your current directory on the local host.>$ scp user@remote.host:~/\{file1,file2,file3\} .</code> linux/shell_commands/copy_over_ssh.txt Last modified: 2019/10/31 09:05by 127.0.0.1