一使用
1、连接到用服务器,在登陆的界面中输入登录账户,输入登陆密码,点击回车。

2、登陆进去后,切换root

sudo -i

3.设置密码
将第一行Lsy改为直接需要设置的root密码,直接粘贴输入进去进行了

echo root:Lsy |sudo chpasswd root
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 restart
最后修改:2023 年 05 月 29 日
如果觉得我的文章对你有用,请随意赞赏