Xshell连接ubuntu失败,提示:Could not connect to '192.168.127.132' (port 22): Connection failed

Could not connect to ‘192.168.127.132’ (port 22): Connection failed.
Xshell连接ubuntu失败,提示:Could not connect to '192.168.127.132' (port 22): Connection failed
本机ping虚拟机能ping通,虚拟机ping 本机也能通,但是就是xshell连接虚拟机(ubuntu)连接不上。
之后同学让我在ubuntu中安装了ssh,命令如下:sudo apt install ssh
安装成功之后,再用xshell连接ubuntu,成功了。
Xshell连接ubuntu失败,提示:Could not connect to '192.168.127.132' (port 22): Connection failed
Xshell连接ubuntu失败,提示:Could not connect to '192.168.127.132' (port 22): Connection failed
【】