(1)查看ip地址是否冲突 我在单位的虚拟机ip地址是192.168.8.85,与其它机器冲突了。改成了192.168.8.83 (2)关闭Ubuntu16.04的防火墙 root@stgman-desktop:~# sudo ufw disable 防火墙在系统启动时自动禁用 亲自尝试了sudo ufw enable,从我的win7系统ssh登录不上虚拟机。但是在Ubuntu本机上ssh 192.168.8.83可以登录成功。 (3)Ubuntu系统上安装、启动sshd服务 sudo apt-get install openssh-server
sudo /etc/init.d/ssh restart
(4)ssh还不能登录上,就修改sshd的默认配置
修改SSH的配置文件/etc/ssh/sshd_config 修改 vim /etc/ssh/sshd_config 找到# Authentication: LoginGraceTime 120 PermitRootLogin without passwd StrictModes yes 改成 # Authentication: LoginGraceTime 120 PermitRootLogin yes StrictModes yes 然后重启SSH服务(/etc/init.d/ssh restart)即可。
使用ps -e | grep ssh,如果只有ssh-agent表示还没启动,需要/etc/init.d/ssh start;有sshd说明已启动。