設有兩機,兩機可相互通訊無問題,中間無防火牆。
兩機 IP 分別為:A:218.29.54.240 B:218.29.54.231
假設 A,B 機的 SSH 都允許 root 登陸
現在需要將 218.29.54.240 root 目錄下的 cacti-0.8.7g.tar.gz 複製到 218.29.54.231 的 root 下
則登陸 218.29.54.240 使用

[root@hn ~]# scp cacti-0.8.7g.tar.gz root@218.29.54.231:/root/ The authenticity of host ‘218.29.54.231 (218.29.54.231)’ can’t be established. RSA key fingerprint is 4a:5c:48:b7:1c:17:3f:2c:60:b4:a2:65:b3:cb:fe:ff. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘218.29.54.231’ (RSA) to the list of known hosts. Address 218.29.54.231 maps to hn.kd.ny.adsl, but this does not map back to the address – POSSIBLE BREAK-IN ATTEMPT! root@218.29.54.231’s password:   這裡輸入 218.29.54.231 的 ssh 密碼 cacti-0.8.7g.tar.gz                 100% 2184KB   2.1MB/s   00:00

登陸 218.29.54.231 驗證

[root@hn ~]# ls anaconda-ks.cfg  cacti-0.8.7g.tar.gz  Desktop  install.log  install.log.syslog

如果 218.29.54.231 的 ssh 埠不是預設的話, 比如是 47457 則在 218.29.54.240 上

[root@hn ~]# scp -P 47457 cacti-0.8.7g.tar.gz root@218.29.54.231:/root/ Address 218.29.54.231 maps to hn.kd.ny.adsl, but this does not map back to the address – POSSIBLE BREAK-IN ATTEMPT! root@218.29.54.231’s password: cacti-0.8.7g.tar.gz                 100% 2184KB   2.1MB/s   00:00   

或者可以在 218.29.54.231 上使用

[root@hn ~]# scp root@218.29.54.240:/root/cacti-0.8.7g.tar.gz /root/ The authenticity of host ‘218.29.54.240 (218.29.54.240)’ can’t be established. RSA key fingerprint is 4a:5c:48:b7:1c:17:3f:2c:60:b4:a2:65:b3:cb:fe:ff. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added ‘218.29.54.240’ (RSA) to the list of known hosts. Address 218.29.54.240 maps to hn.kd.ny.adsl, but this does not map back to the address – POSSIBLE BREAK-IN ATTEMPT! root@218.29.54.240’s password: cacti-0.8.7g.tar.gz                 100% 2184KB   2.1MB/s   00:00 [root@hn ~]# ls anaconda-ks.cfg  cacti-0.8.7g.tar.gz  Desktop  install.log  install.log.syslog