【Linux CentOS 在虚拟机中XShell出现: (port 22): Connection failed.】

原因:没安装openssh-server组件!!!!!!!!!!

解决办法:yum install openssh-server 

查看openssh-server是否启动: 

$:ps -ef |grep ssh 

如果看到/usr/sbin/sshd,说明服务已经启动,否则服务尚未启动,那么需要启动server: 

/etc/init.d/ssh start 

-------------注意:还需要设置开机启动-------------------

vi  /etc/rc.d/rc.local

追加:/etc/init.d/ssh start 

完毕!

原文地址:https://www.cnblogs.com/micro-chen/p/5340028.html