Skip to content

Instantly share code, notes, and snippets.

@devCharles
Last active October 12, 2020 22:09
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 devCharles/35261f67341c40804997aca8297fa8d1 to your computer and use it in GitHub Desktop.
Save devCharles/35261f67341c40804997aca8297fa8d1 to your computer and use it in GitHub Desktop.
Configure AWS EC2 to use ssh keys instead of .pem files

EC2 config to not use pem file and use ssh key instead

  1. Open sshd_config file
sudo vi /etc/ssh/sshd_config
  1. Look for PasswordAuthentication No and change it to PasswordAuthentication Yes
  2. Save the file
  3. Restart ssh demon
sudo /etc/init.d/ssh restart
  1. Try connecting to check if it works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment