Last active
April 4, 2017 19:34
-
-
Save dialt0ne/547f824b31e0b794ce642e228264c88b 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
#!/bin/bash | |
SSH_PUB_DIR="$HOME/.ssh/pub" | |
mkdir -p $SSH_PUB_DIR | |
for PRIVATE in *.pem; | |
do | |
PUBLIC=`echo $PRIVATE | sed 's/\(.*\).pem/\1/'`.pub; | |
if [ ! -f "$SSH_PUB_DIR/$PUBLIC" ] | |
then | |
echo $PRIVATE to $PUBLIC; | |
ssh-keygen -y -f $PRIVATE > $SSH_PUB_DIR/$PUBLIC; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run from
~/.ssh
. Then usessh-add -d ~/.ssh/pub/$KEYNAME.pub
to remove an individual key from ssh-agent