Created
October 11, 2017 08:27
-
-
Save ChatchaiJ/e6766b63887c35a10fb909b062c9b0df to your computer and use it in GitHub Desktop.
Strictly force ssh to use only public key for authentication
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
#!/bin/sh | |
SSHOPTS="-q -o PasswordAuthentication=no -o KbdInteractiveAuthentication=no -o ChallengeResponseAuthentication=no -o StrictHostKeyChecking=no" | |
SSH="/usr/bin/ssh $SSHOPTS" | |
IP="127.0.0.1" | |
[ "$1" ] && IP="$1" | |
$SSH $IP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment