学习笔记指令服务器ROOT权限密码登录旧絮2022-10-172024-04-21方法11234567891011sudo -i //切换到rootpasswd //设置密码sudo sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;sudo sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;sudo service sshd restartreboot //重启服务器 方法21234567891011sudo -i //用root身份passwd //设置root密码vi /etc/ssh/sshd_config //修改配置文件PermitRootLogin yesPasswordAuthentication yesreboot //重启服务器