ubuntu20.04开启root权限登陆
1、使用普通用户登录后切换root
sudo -i
2、修改root的密码
echo root:123123 |sudo chpasswd root
3、开启root登录
sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config
4、开启密码验证
sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config
5、重启ssh服务
service sshd restart
黑蜘蛛