Xshell无法连接虚拟机中的Linux
使用Xshell连接虚拟机时中的Linux时,显示Could not connect to ‘192.168.xxx.xxx’ (port 22): Connection failed.
`使用Xshell连接虚拟机时中的Linux时,显示Could not connect to ‘192.168.xxx.xxx’ (port 22): Connection failed.(此时虚拟机中的Linux已经开启,网络设置正确,Xshell里配置的ip地址正确)
原因
配置Linux属性时出现的错误。
解决方法
1.安装ssh
yum install openssh-server
配置文件在 /etc/ssh/sshd_config,默认端口为22
2
将ssh服务添加到自启动列表中
systemctl enable sshd.service
3
启动ssh
systemctl start sshd.service
4
查看端口是否运行
netstat -an | grep 22
5
在Xshell里测试连接
引用于
https://blog.csdn.net/weixin_46757915/article/details/122494050