-
-
Save dideler/d2a726a85bc48686aebb to your computer and use it in GitHub Desktop.
Load your SSH key from USB stick. Forked from http://tammersaleh.com/posts/building-an-encrypted-usb-drive-for-your-ssh-keys-in-os-x/
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
#!/usr/bin/env bash | |
# Script to load keys and (force) eject. | |
# If no hour value is given for the key's lifetime, it defaults to 4 hours. | |
# | |
# Usage (OS X): | |
# /Volumes/keys/load <optional hour value> | |
# <enter decryption password> | |
HOURS="$1" | |
DIR="/Volumes/keys" | |
KEY="$DIR/id_rsa" | |
if [ -z $HOURS ]; then | |
HOURS=4 | |
fi | |
/usr/bin/ssh-add -D # Delete all identities on the machine. | |
/usr/bin/ssh-add -t ${HOURS}H $KEY | |
/usr/sbin/diskutil umount force $DIR | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Deprecated. See https://github.com/dideler/usb-ssh-key