首先,开启ssh服务,执行以下命令:/etc/init.d/ssh start 或 service sshd start
然后ifconfig查看其ip地址,当Xshell连接虚拟机时,提示:SSH服务器拒绝了密码。请再试一次。
sshd的设置不允许root用户用密码远程登录
修改 vim /etc/ssh/sshd_config
找到# Authentication: LoginGraceTime 120 PermitRootLogin without passwd StrictModes yes
改成
# Authentication: LoginGraceTime 66666 PermitRootLogin yes StrictModes yes 重启服务service sshd restart
开机启动服务
[root@compy ~]# chkconfig sshd on
[root@compy ~]# chkconfig --list sshd
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off