良许Linux教程网 干货合集 详解Linux远程控制具体方法

详解Linux远程控制具体方法

Linux一般作为服务器使用,而服务器一般放在机房,你不可能在机房操作你的Linux服务器这时我们就需要远程登录到Linux服务器来管理维护系统。本篇文章重点为大家分享一下Linux远程控制具体方法,有需要的小伙伴可以参考一下。

详解Linux远程控制具体方法

从192.168.10.5这台机登录到192.168.10.16这台机上,可以在192.168.10.16做一些操作,比如拷贝文件。

192.168.10.5

[root@localhost ~]# cd /tmp
[root@localhost tmp]# ifconfig
ens32: flags=4163  mtu 1500
       inet 192.168.10.5  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe84:eae5  prefixlen 64  scopeid 0x20
       ether 00:0c:29:84:ea:e5  txqueuelen 1000  (Ethernet)
       RX packets 113798033  bytes 13848840312 (12.8 GiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 89922573  bytes 134234526128 (125.0 GiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 168  bytes 14260 (13.9 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 168  bytes 14260 (13.9 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost tmp]# ls
[root@localhost tmp]# pwd
/tmp

192.168.10.16

[root@localhost ~]# cd /tmp
[root@localhost tmp]# ifconfig
ens32: flags=4163  mtu 1500
       inet 192.168.10.16  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe62:fcc4  prefixlen 64  scopeid 0x20
       ether 00:0c:29:62:fc:c4  txqueuelen 1000  (Ethernet)
       RX packets 20886  bytes 7480105 (7.1 MiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 10471  bytes 7083155 (6.7 MiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 580  bytes 49312 (48.1 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 580  bytes 49312 (48.1 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost tmp]# ls
PHP.gif  test  timestamp.txt  程序员等级判别.jpg  背锅.gif  重启.jpg
[root@localhost tmp]# pwd
/tmp

从192.168.10.5登录到192.168.10.16

[root@localhost tmp]# ssh root@192.168.10.16
root@192.168.10.16's password:
Last login: Wed Jun 19 22:12:56 2019 from 192.168.10.5
[root@localhost ~]# ifconfig
ens32: flags=4163  mtu 1500
       inet 192.168.10.16  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe62:fcc4  prefixlen 64  scopeid 0x20
       ether 00:0c:29:62:fc:c4  txqueuelen 1000  (Ethernet)
       RX packets 21050  bytes 7495118 (7.1 MiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 10554  bytes 7095520 (6.7 MiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 580  bytes 49312 (48.1 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 580  bytes 49312 (48.1 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

从192.168.10.16拷贝文件到192.168.10.5

[root@localhost ~]# cd /tmp
[root@localhost tmp]# ls
PHP.gif  test  timestamp.txt  程序员等级判别.jpg  背锅.gif  重启.jpg
[root@localhost tmp]# scp 程序员等级判别.jpg root@192.168.10.5:/tmp
The authenticity of host '192.168.10.5 (192.168.10.5)' can't be established.
ECDSA key fingerprint is 60:aa:a7:f2:b2:bb:24:d4:31:50:2a:4f:50:82:e0:80.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.10.5' (ECDSA) to the list of known hosts.
root@192.168.10.5's password:
程序员等级判别.jpg                                100%   12KB  12.1KB/s   00:00    
[root@localhost tmp]# exit #退出远程登录
logout
Connection to 192.168.10.16 closed.
[root@localhost tmp]# ifconfig #确认已经回到192.168.10.5
ens32: flags=4163  mtu 1500
       inet 192.168.10.5  netmask 255.255.255.0  broadcast 192.168.10.255
       inet6 fe80::20c:29ff:fe84:eae5  prefixlen 64  scopeid 0x20
       ether 00:0c:29:84:ea:e5  txqueuelen 1000  (Ethernet)
       RX packets 113798588  bytes 13848904758 (12.8 GiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 89923000  bytes 134234574328 (125.0 GiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10
       loop  txqueuelen 1  (Local Loopback)
       RX packets 168  bytes 14260 (13.9 KiB)
       RX errors 0  dropped 0  overruns 0  frame 0
       TX packets 168  bytes 14260 (13.9 KiB)
       TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

[root@localhost tmp]# ls
#已经成功从192.168.10.16拷贝文件到192.168.10.5
程序员等级判别.jpg  

以上就是良许教程网为各位朋友分享的Linux系统相关内容。想要了解更多Linux相关知识记得关注公众号“良许Linux”,或扫描下方二维码进行关注,更多干货等着你 !

img
本文由 良许Linux教程网 发布,可自由转载、引用,但需署名作者且注明文章出处。如转载至微信公众号,请在文末添加作者公众号二维码。
良许

作者: 良许

良许,世界500强企业Linux开发工程师,公众号【良许Linux】的作者,全网拥有超30W粉丝。个人标签:创业者,CSDN学院讲师,副业达人,流量玩家,摄影爱好者。
上一篇
下一篇

发表评论

联系我们

联系我们

公众号:良许Linux

在线咨询: QQ交谈

邮箱: yychuyu@163.com

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部