Skip to content

Instantly share code, notes, and snippets.

@oliverralbertini
Created December 12, 2017 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliverralbertini/6012329110ad094d751e2988b69f1f3c to your computer and use it in GitHub Desktop.
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
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
)
}
@oliverralbertini
Copy link
Author

Originally from here.

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