Ubuntu24启用root登录 By jena · 21 2 月, 2025 · Ubuntu · Leave a comment 1. 设置 root 密码 sudo passwd root 2. 修改 SSH 配置 1)编辑 SSH 配置文件: sudo vi /etc/ssh/sshd_config 2)找到 PermitRootLogin 这一行,取消#注释,并修改为: PermitRootLogin yes 3) 保存并退出编辑器后,重启 SSH 服务: sudo systemctl restart sshd #or sudo service ssh restart 大功告成❣️