Skip to content

Instantly share code, notes, and snippets.

@renbaoshuo
Last active January 24, 2023 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save renbaoshuo/f4ba93f0cc895862a99c7daa8b61cffa to your computer and use it in GitHub Desktop.
Save renbaoshuo/f4ba93f0cc895862a99c7daa8b61cffa to your computer and use it in GitHub Desktop.
#!/bin/bash
mkdir -p ~/.ssh
curl -s https://github.com/renbaoshuo.keys >> ~/.ssh/authorized_keys
sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
sed -i 's|UsePAM yes|UsePAM no|g' /etc/ssh/sshd_config
echo "PubkeyAcceptedKeyTypes=+ssh-rsa" >> /etc/ssh/sshd_config
systemctl restart ssh.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment