一、问题

使用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 账户
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐