Skip to content

Instantly share code, notes, and snippets.

@dialt0ne
Last active April 4, 2017 19:34
Show Gist options
  • Save dialt0ne/547f824b31e0b794ce642e228264c88b to your computer and use it in GitHub Desktop.
Save dialt0ne/547f824b31e0b794ce642e228264c88b to your computer and use it in GitHub Desktop.
#!/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
@dialt0ne
Copy link
Author

dialt0ne commented Jul 8, 2016

Run from ~/.ssh. Then use ssh-add -d ~/.ssh/pub/$KEYNAME.pub to remove an individual key from ssh-agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment