一、问题
使用xshell 通过 ssh 连接 vm 虚拟机下的 ubuntu12.04,提示服务器拒绝了密码。
二、解决方法
- 1、尝试修改
vim /etc/ssh/sshd_config
文件的如下内容
# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes
...
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes
修改后重启 ssh,如果还是无法连接,请看下一步。
- 2、修改 root 密码,以启用 root 账户
#ubuntu默认是不启用root用户也不允许root远程登录的。
sudo passwd root //修改后自动启用 root 账户