Last active
December 23, 2015 20:49
-
-
Save bbrks/6692143 to your computer and use it in GitHub Desktop.
Easily regenerate SSH keys... just in case
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
#!/bin/sh | |
# nukekeys.sh | |
# Easily regenerate SSH keys... just in case | |
# https://gist.github.com/bbrks/6692143 | |
read -p "WARNING: This will regenerate ALL *_rsa keys!! Are you sure? " -n 1 -r | |
if [[ ! $REPLY =~ ^[Yy]$ ]] | |
then | |
exit 1 | |
fi | |
cd ~/.ssh | |
BITS=8192; | |
keys=(*_rsa) | |
rm -f *_rsa | |
rm -f *_rsa.pub | |
for i in "${keys[@]}" | |
do : | |
echo "\nEnter passphrase for ${i}" | |
ssh-keygen -b $BITS -t rsa -q -f $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment