Created
December 12, 2017 21:26
-
-
Save oliverralbertini/6012329110ad094d751e2988b69f1f3c to your computer and use it in GitHub Desktop.
bash function to set up a gpg key from a yubikey as an ssh key
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
yubishell() { | |
( | |
gpg-connect-agent --quiet updatestartuptty /bye | |
export GPG_TTY=$(tty) | |
export SSH_AUTH_SOCK="$HOME/.gnupg/S.gpg-agent.ssh" | |
export PS1="\[\e[31m\][YUBI]\[\e[0m\] \$ " | |
if which kr > /dev/null 2>&1; then | |
kr unpair | |
fi | |
bash --norc | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally from here.