scp命令基本用法

gholay發表於2013-12-28
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 ~]#

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29196873/viewspace-1065307/,如需轉載,請註明出處,否則將追究法律責任。