linux系统中scp命令实现服务器之间数据的传输

1、从本地服务器传输至另一台服务器

测试服务器连通性:

[[email protected] test]# ifconfig | head -n 3   ## 查看本机服务器ip
ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.3.83  netmask 255.255.255.0  broadcast 192.168.3.255
        inet6 fe80::ede3:5653:e765:1b1a  prefixlen 64  scopeid 0x20<link>
[[email protected] test]# ping -c 3 192.168.3.33   ## 测试与远程服务器连通性
PING 192.168.3.33 (192.168.3.33) 56(84) bytes of data.
64 bytes from 192.168.3.33: icmp_seq=1 ttl=64 time=4.02 ms
64 bytes from 192.168.3.33: icmp_seq=2 ttl=64 time=2.42 ms
64 bytes from 192.168.3.33: icmp_seq=3 ttl=64 time=2.23 ms

--- 192.168.3.33 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 2.239/2.895/4.027/0.804 ms

2、将本地文件传输至远程服务器


[[email protected] test]# ls
outcome.map  outcome.ped
[[email protected] test]# scp outcome.map [email protected]:/home/test/
[email protected]'s password:                                ## 这里要输入远程服务器对应用户(这里是root)的密码
outcome.map                                                                                        100% 1315KB   6.5MB/s   00:00

3、将远程服务器文件传输至本地服务器

[[email protected] test]# ls
outcome.map  outcome.ped
[[email protected] test]# scp [email protected]:/home/test/test.txt ./
[email protected]'s password:
test.txt                                                                                           100%   22     3.6KB/s   00:00
[[email protected] test]# ls
outcome.map  outcome.ped  test.txt

标签: 服务器, linux, root, scp, 192.168, 服务器之间, test, outcome

相关文章推荐

添加新评论,含*的栏目为必填