认情况下拒绝root的SSH远程shell访问权限。
如果以root身份尝试远程登录,都将收到“拒绝”消息:
$ ssh root@10.0.0.55 root@10.0.0.55's password: Permission denied, please try again. root@10.0.0.55's password:
在Ubuntu 16.04 Xenial Xerus Linux上启用root ssh登录:
$ sudo sed -i 's/prohibit-password/yes/' /etc/ssh/sshd_config
或者手动打开sshd配置文件/etc/ssh/sshd_config
将 PermitRootLogin prohibit-password 改成 PermitRootLogin yes
重启SSH守护程序:
$ sudo systemctl restart sshd
现在将能够以root用户远程登录:
$ ssh root@10.0.0.55 root@10.0.0.55's password: Welcome to Ubuntu 16.04 LTS (GNU/Linux 4.4.0-22-generic x86_64) * Documentation: https://help.ubuntu.com/ 22 packages can be updated. 20 updates are security updates.
日期:2020-07-07 20:56:07 来源:oir作者:oir
