解决xshell无法远程连接

背景

使用xshell连接linux虚拟机时出现了Could not connect to ‘x.x.x’ (port 22): Connection failed.错误。linux虚拟机使用vmware.外部连接使用NAT模式。

解决步骤

一. 查看虚拟网络编辑器中NAT模式的配置

1.点击虚拟网络配置器
xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.
2.点击NAT设置
xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.
3.记录子网IP、子网掩码、网关的数据xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.
4.打开网络适配器,找到linux虚拟机配置的网络适配器,右键再点击属性(虚拟机配置适配器后会在windows显示)
xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.
5.双击箭头指向的选项
xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.
6.图中的三个输入框就填在虚拟机NAT中设置的数据,NAT这三个设置了什么,这里就填什么。
xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.
7.使用xhell连接测试成功
xshell:Could not connect to ‘x x x‘ (port 22): Connection failed.

相关文章: