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
著作权归作者所有。
商业转载请联系作者获得授权,非商业转载请注明出处。
作者:JefskyWong ——程序猿甜品店
链接:https://www.jefsky.com/blog/238
来源:https://www.jefsky.com/