1. 程式人生 > 其它 >如何使用遠端工具連線Linux伺服器

如何使用遠端工具連線Linux伺服器

大家好,今天我想和大家分享一下Linux如何連線遠端控制工具
我們都知道,Linux是著名的開源伺服器作業系統,而在運維工程師的實際工作當中,我們不大可能時時刻刻都在伺服器本地操作。
因此這時,我們要用遠端控制工具來管理伺服器


系統版本: (centos 7)
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[root@localhost ~]#

在內網當中測試 (vmnet 1)

檢視Windows 的ip地址

配置本地網絡卡ens33
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33


:wq (儲存退出)

[root@localhost ~]# systemctl restart network //重啟網路服務

檢視ens33 (本地網絡卡)的地址

[root@localhost ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.75.2 netmask 255.255.255.0 broadcast 192.168.75.255
inet6 fe80::617f:ef93:80d4:e14e prefixlen 64 scopeid 0x20
ether 00:0c:29:87:af:a6 txqueuelen 1000 (Ethernet)
RX packets 3635 bytes 247237 (241.4 KiB)
RX errors 0 dropped 4 overruns 0 frame 0
TX packets 434 bytes 44488 (43.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

[root@localhost ~]#

測試與windows主機通訊

[root@localhost ~]# ping 192.168.75.1
PING 192.168.75.1 (192.168.75.1) 56(84) bytes of data.
64 bytes from 192.168.75.1: icmp_seq=1 ttl=128 time=0.367 ms
64 bytes from 192.168.75.1: icmp_seq=2 ttl=128 time=0.163 ms
64 bytes from 192.168.75.1: icmp_seq=3 ttl=128 time=0.144 ms
^C
— 192.168.75.1 ping statistics —
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 0.144/0.224/0.367/0.102 ms

主機通訊正常

開啟xshell(遠端控制工具)

ssh 192.168.75.2

我們成功連線了192.168.75.2 的這臺Linux主機

謝謝大家,有問題可以給我留言