xshell连接不上虚拟机

一,启动:service ssh start

如未安装则sudo apt-get install openssh-server

安装完成后service sshd start启动

查看是否启动成功:ps - e |grep ssh

二,更改ip地址(我试了没效果)

xshell连接不上虚拟机

二,关闭防火墙:

service iptables stop

chkconfig iptables off

开放22端口:sudo ufw allow 22

三,若提示ssh拒绝密码,则进入cd /etc/ssh

vim sshd_config

将 # Authentication:

LoginGraceTime 120

PermitRootLogin prohibit-password

StrictModes yes

改为:

#Authentication:

LoginGraceTime 120

PermitRootLogin yes

StrictModes yes