Ubuntu切换root

Ubuntu切换root
小陈笔记一、进入管理员
1 | sudo -i |
二、修改密码
1 | passwd root |
然后输入密码(这个时候输入密码是不显示的)
三、
1 | vim /etc/ssh/sshd_config |
四、输入“i”进入插入模式
显示– INSERT –说明进入插入模式。
找到:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
在下面输入
1 | PermitRootlogin yes |
五、保存
按esc键盘,输入:wq保存
输入:
1 | systemctl restart ssh |
重启ssh