Last active
August 29, 2015 14:24
-
-
Save chernjie/a460bd042f4de18e8656 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# Set the following SSH configurations to no: | |
# ChallengeResponseAuthentication | |
# PasswordAuthentication | |
# UsePAM | |
test -f /etc/ssh/sshd_config || exit 1 | |
sed -i -r -e \ | |
"s/^(ChallengeResponseAuthentication|PasswordAuthentication|UsePAM)\s+\S+$/\1 no/g" \ | |
/etc/ssh/sshd_config | |
grep -e ^ChallengeResponseAuthentication -e ^PasswordAuthentication -e ^UsePAM /etc/ssh/sshd_config | |
service ssh restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment