一、虚拟机上安装 openssh-server
$ sudo apt-get install openssh-server
二、启动SSH
# 启动
$ sudo server ssh start
# 验证启动
$ ps -ef | grep ssh
三、查看虚拟机的IP
$ ifconfig
ens33 Link encap:Ethernet HWaddr 00:0c:29:12:89:27
inet addr:192.168.47.129 Bcast:192.168.47.255 Mask:255.255.255.0
inet6 addr: fe80::f15f:64ec:eb11:9ae6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:29852 errors:0 dropped:0 overruns:0 frame:0
TX packets:8877 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:43574480 (43.5 MB) TX bytes:558227 (558.2 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:287 errors:0 dropped:0 overruns:0 frame:0
TX packets:287 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:26806 (26.8 KB) TX bytes:26806 (26.8 KB)
四、XShell链接本地虚拟机
点击“确定”即可。