scp 用于传输文件到另外一个服务器环境,
命令格式:
scp -p port user@serverip:/home/user/filename /home/user/filename
例子:
[root@localhost ~]# pwd
/root
[root@localhost ~]# ls
anaconda-ks.cfg ftpaccount install.log.syslog
backup.tar.gz install.log svn1.4.3
[root@localhost ~]# scp backup.tar.gz root@192.168.1.21:/tmp/
The authenticity of host '192.168.1.21 (192.168.1.21)' can't be established.
RSA key fingerprint is 4d:b4:e1:5b:80:8f:ea:df:0a:eb:dd:30:e7:00:07:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.21' (RSA) to the list of known hosts.
root@192.168.1.21's password: << 提示输入192.168.1.21的SSH密码
backup.tar.gz 100% 5120KB 1.3MB/s 00:04
[root@localhost ~]#
命令格式:
scp -p port user@serverip:/home/user/filename /home/user/filename
例子:
[root@localhost ~]# pwd
/root
[root@localhost ~]# ls
anaconda-ks.cfg ftpaccount install.log.syslog
backup.tar.gz install.log svn1.4.3
[root@localhost ~]# scp backup.tar.gz root@192.168.1.21:/tmp/
The authenticity of host '192.168.1.21 (192.168.1.21)' can't be established.
RSA key fingerprint is 4d:b4:e1:5b:80:8f:ea:df:0a:eb:dd:30:e7:00:07:90.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.21' (RSA) to the list of known hosts.
root@192.168.1.21's password: << 提示输入192.168.1.21的SSH密码
backup.tar.gz 100% 5120KB 1.3MB/s 00:04
[root@localhost ~]#
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29196873/viewspace-1065307/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29196873/viewspace-1065307/