ubuntu server 16.04 开启root密码登录

0x00 ubuntu server 16.04 开启root密码登录

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

0x01 为root账户设置密码

$ sudo passwd root

0x02 进入root账户

$ su root

0x03 编辑sshd_config文件

$ vi /etc/ssh/sshd_config
做如下修改:

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

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

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

0x04 重启sshd服务

$ sudo service ssh restart

本文转载自http://kiros.onbeta.com/Linux/ubuntu-server-1604-kai-qiroot-mi-ma-deng-lu.html

posted @ 2019-03-01 16:50  kiroshan  阅读(3633)  评论(0编辑  收藏  举报