SCP工具可实现linux系统中文件的相互传输,需要输入相应的用户名和密码
### 将本机的f1文件传送到10.0.0.11机器的root文件下
scp /root/f1 root@10.0.0.11:/root/
### 把10.0.0.11上的/data目录下载到本地服务器上
scp root@10.0.0.11:/data /root/
==============例题==============
#将文件传输到10.0.0.12机器的root目录下
[root@centos7 /var/www/html]#scp /var/www/html/qqfarm.sql root@10.0.0.12:/root
The authenticity of host '10.0.0.12 (10.0.0.12)' can't be established.
ECDSA key fingerprint is SHA256:NI9laeEZDfn1edY6QW19G+mJkoxq+ay5A2QALxBR/VI.
ECDSA key fingerprint is MD5:46:18:9d:76:a6:88:40:fb:f8:2e:ff:36:d7:dd:83:66.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added '10.0.0.12' (ECDSA) to the list of known hosts.
root@10.0.0.12's password:
qqfarm.sql 100% 3363 689.1KB/s 00:00
#查看侵权farm.sql文件
[root@centos7 ~]#ls
anaconda-ks.cfg mysql-5.7.42-linux-glibc2.12-x86_64.tar.gz
install_mysql57_all.sh qqfarm.sql
#将qqfarm数据导入到MySQL数据库中
[root@centos7 ~]#mysql -h localhost -uucenter -pucenter ucenter < qqfarm.sql
mysql: [Warning] Using a password on the command line interface can be insecure.