ubuntu允许root用户ssh远程登录:

添加root用户远程登录:

1)sudo passwd root为root添加密码。

2)开启root通过ssh远程登录编辑/etc/ssh/sshd_config将PermitRootLogin改为yes

3)services sshd restart或者systemctl restart sshd。

二、禁止root远程登录
需要编辑/etc/ssh/sshd_config。
vim /etc/ssh/sshd_config    找到 PermitRootLogin
改为 PermitRootLogin no
重启  service sshd restart

猜你喜欢

转载自blog.csdn.net/u013171226/article/details/107680335