skip to content
小陈笔记

Ubuntu切换root

/ 1 min read

一、进入管理员

sudo -i

二、修改密码

passwd root

然后输入密码(这个时候输入密码是不显示的)

三、

vim /etc/ssh/sshd_config

四、输入“i”进入插入模式

显示– INSERT –说明进入插入模式。

找到: #LoginGraceTime 2m #PermitRootLogin prohibit-password

在下面输入

PermitRootlogin yes

五、保存

按esc键盘,输入:wq保存

输入:

systemctl restart ssh

重启ssh