or甲骨文 AWS Lightsail 开启root登陆权限(User data),也可适用于EC2, GCP, AZURE等

将下面代码中的第一句中的Vicer改为自己将要设置的密码.
创建instance</strong>时,点击add launch script将下列代码复制进去(注意更改root密码).
#!/bin/bash
echo root:Vicer |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 reboot

对于EC2,GCE等机器也可以使用.不能添加代码的机器,可以登录进ssh,再执行上面的代码.也可以开启root登陆.

DD脚本 前提是系统ub16

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 10 -v 64 -a -p youpassword
THE END
分享
二维码
< <上一篇
下一篇>>