gcp_root_ssh.sh 410 B

12345678910111213141516
  1. #!/bin/bash
  2. # Google Cloud Platform GCP实例开启密码与root用户登陆
  3. # GCP一键启用root帐号命令
  4. # wget -qO- git.io/fpQWf | bash
  5. # GCP 启用root密码登陆
  6. sed -i "s/PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config
  7. sed -i "s/PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config
  8. # 重启ssh服务
  9. systemctl restart ssh
  10. # 修改root 密码
  11. passwd