常用命令有:sftp,scp
sftp
[root@zengmg develop_soft]# sftp 192.168.255.132
Connecting to 192.168.255.132...
The authenticity of host '192.168.255.132 (192.168.255.132)' can't be established.
RSA key fingerprint is bd:09:eb:22:2f:ed:95:57:ab:89:f0:98:2d:40:35:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.255.132' (RSA) to the list of known hosts.
Connecting to 192.168.255.132...
The authenticity of host '192.168.255.132 (192.168.255.132)' can't be established.
RSA key fingerprint is bd:09:eb:22:2f:ed:95:57:ab:89:f0:98:2d:40:35:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.255.132' (RSA) to the list of known hosts.
root@192.168.255.132's password:?
sftp> put /develop_soft/*.gz /develop_soft/
Uploading /develop_soft/hadoop-2.7.2.tar.gz to /develop_soft/hadoop-2.7.2.tar.gz
/develop_soft/hadoop-2.7.2.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?100% ?202MB ?50.6MB/s ? 00:04 ? ?
Uploading /develop_soft/jdk-8u73-linux-x64.tar.gz to /develop_soft/jdk-8u73-linux-x64.tar.gz
/develop_soft/jdk-8u73-linux-x64.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?100% ?173MB ?28.8MB/s ? 00:06 ? ?
sftp> exit
sftp> put /develop_soft/*.gz /develop_soft/
Uploading /develop_soft/hadoop-2.7.2.tar.gz to /develop_soft/hadoop-2.7.2.tar.gz
/develop_soft/hadoop-2.7.2.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?100% ?202MB ?50.6MB/s ? 00:04 ? ?
Uploading /develop_soft/jdk-8u73-linux-x64.tar.gz to /develop_soft/jdk-8u73-linux-x64.tar.gz
/develop_soft/jdk-8u73-linux-x64.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?100% ?173MB ?28.8MB/s ? 00:06 ? ?
sftp> exit
SCP
scp -rp user1@host1:/filepath1 user2@host2:/filepath2
-p ? ? ?Preserves modification times, access times, and modes from the original file.
備份模式(修改時間、訪問時間及modes)
-r ? ? ?Recursively copy entire directories.
遞歸地復制整個目錄
-p ? ? ?Preserves modification times, access times, and modes from the original file.
備份模式(修改時間、訪問時間及modes)
-r ? ? ?Recursively copy entire directories.
遞歸地復制整個目錄
實例:
[root@zengmg develop_soft]# scp *.gz root@192.168.255.133:/develop_soft
The authenticity of host '192.168.255.133 (192.168.255.133)' can't be established.
RSA key fingerprint is bd:09:eb:22:2f:ed:95:57:ab:89:f0:98:2d:40:35:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.255.133' (RSA) to the list of known hosts.
RSA key fingerprint is bd:09:eb:22:2f:ed:95:57:ab:89:f0:98:2d:40:35:c9.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.255.133' (RSA) to the list of known hosts.
root@192.168.255.133's password:?
hadoop-2.7.2.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?100% ?202MB ?67.4MB/s ? 00:03 ? ?
jdk-8u73-linux-x64.tar.gz ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?100% ?173MB ?34.6MB/s ? 00:05 ? ?
-p ? ? ?Preserves modification times, access times, and modes from the original file.
備份模式(修改時間、訪問時間及modes)
-r ? ? ?Recursively copy entire directories.
遞歸地復制整個目錄