Skip to content

Instantly share code, notes, and snippets.

@ChatchaiJ
Created October 11, 2017 08:27
Show Gist options
  • Save ChatchaiJ/e6766b63887c35a10fb909b062c9b0df to your computer and use it in GitHub Desktop.
Save ChatchaiJ/e6766b63887c35a10fb909b062c9b0df to your computer and use it in GitHub Desktop.
Strictly force ssh to use only public key for authentication
#!/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