Last active
July 29, 2023 11:45
-
-
Save 24HOURSMEDIA/95f35dc7b8c44b8efabbcb73273b342d to your computer and use it in GitHub Desktop.
public key authentication only
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add your ssh keys first to .ssh/authorized keys | |
# Be sure to have the proper permissions: | |
chmod 700 ~/.ssh | |
chmod 644 ~/.ssh/authorized_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/ssh/sshd_config.d/pubkey_only.conf | |
PasswordAuthentication no | |
PubkeyAuthentication yes | |
ChallengeResponseAuthentication no | |
PermitRootLogin no | |
PermitRootLogin prohibit-password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove the password for the user | |
sudo passwd USERNAME -d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment