(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说明已启动。
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有