Xshell连接虚拟机失败Could not connect to '192.xxx.xx.xxx' (port 22): Connection failed.

之后的工作会使用Xshell,今天搞一个下来连接自己的虚拟机,发现连接失败:

Xshell连接虚拟机失败Could not connect to '192.xxx.xx.xxx' (port 22): Connection failed.

猜想是可能是虚拟机或者Xshell部分没设置好

查询后通过以下方法解决,做此记录:

1.安装OpenSSH,执行sudo apt-get install openssh-server openssh-client命令。

Xshell连接虚拟机失败Could not connect to '192.xxx.xx.xxx' (port 22): Connection failed.

2.执行netstat -tnl命令,查看22端口。

Xshell连接虚拟机失败Could not connect to '192.xxx.xx.xxx' (port 22): Connection failed.

博主通过以上方法已可以接连上。

Xshell连接虚拟机失败Could not connect to '192.xxx.xx.xxx' (port 22): Connection failed.

参考地址:https://blog.****.net/s243471087/article/details/80208985