ubuntu server 开启root密码登录

ubuntu server 16.04 开启root密码登录
由于众多VPS默认使用证书验证登录,虽然安全但使用十分不便,所以特提供开启root用户并使用密码登录方法。

root账户设置密码
$ sudo passwd root

进入root账户
$ su root

编辑sshd_config文件
$ vi /etc/ssh/sshd_config
做如下修改:

1.允许root账户登录
PermitRootLogin without-password
~修改为~
PermitRootLogin yes

2.允许密码登录
PasswordAuthentication no
~修改为~
PasswordAuthentication yes

3.关闭证书验证登录(::确认可以使用密码登录后再做此修改,避免发生无法登录服务器的验证后果::)
UsePAM yes
~修改为~
UsePAM no

重启sshd服务
$ sudo service ssh restart


已发布

分类

作者:

标签

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注