1. 获取超级管理员权限首先,我们需要获取超级管理员权限,执行以下命令:sudo -i2. 设置用户权限将username替换为你的用户名,执行以下命令,将用户添加到/etc/sudoers.d/root文件中:echo ‘username ALL=(ALL:ALL) NOPASSWD:ALL’ | sudo tee -a /etc/sudoers.d/root3. 开启超权限登录接下来,我们需要修改/etc/ssh/sshd_config文件,开启超权限登录。执行以下命令:sudo sed -i -e ‘s/#PermitRootLogin prohibit-password/PermitRootLogin yes/g’ -e ‘s/#PasswordAuthentication yes/PasswordAuthentication yes/g’ /etc/ssh/sshd_config4. 为用户设置密码将username替换为你的用户名,将password替换为你的密码,执行以下命令设置用户密码:echo username:password| chpasswd5. 重启SSH服务

Linux 2023-08-27