ubuntu server 20.4设置使用root登录

发布时间 2023-05-27 11:19:40作者: lzy1666
ubuntu@ubuntu:~$ sudo passwd root
New password: 
Retype new password: 
passwd: password updated successfully
ubuntu@ubuntu:~$ su root # 切换到root账户
Password: 
root@ubuntu:/home/ubuntu# 

使用vim /etc/ssh/sshd_config编辑配置文件

找到#PermitRootLogin prohibit-password并在下面新建一行PermitRootLogin yes

#PermitRootLogin prohibit-password
PermitRootLogin yes

保存并退出!然后输入reboot重启树莓派

然后就可以使用ssh远程登录root账号了