连接xshell
第一步:使用ifconfig
命令,查找IP地址
[root@master lyf]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.64.128 netmask 255.255.255.0 broadcast 192.168.64.255
inet6 fe80::2376:f203:5e45:6ec2 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:25:b4:45 txqueuelen 1000 (Ethernet)
RX packets 534 bytes 262308 (256.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 478 bytes 44521 (43.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 48 bytes 4080 (3.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 48 bytes 4080 (3.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:c1:f2:c0 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
其中inet后面接的即为IP地址,当前IP地址为:192.168.64.128(具体情况视自己IP地址而定)
第二步:打开xshell,点击“新建一个会话”
- 第三步:输入名称与虚拟机IP(注意不要写错了),而后点连接
- 第四步:输入虚拟机的用户名,然后点确定
- 第五步:输入密码并确定
- 第六步:确定后出现连接成功界面,即可进行shell编程