Last active
March 14, 2017 18:44
-
-
Save smashwilson/4420b235922581ea3d7b26769ee8ec9e to your computer and use it in GitHub Desktop.
Use the GPG pinentry-mac app for SSH keys
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
#!/bin/sh | |
# | |
# chmod +x this script and set it as SSH_ASKPASS. | |
set -euo pipefail | |
urldecode() { | |
python -c 'import sys, urllib; sys.stdout.write(urllib.unquote(sys.stdin.read()))' | |
} | |
pinentry-mac <<EOM | grep '^D ' | sed -e 's/^D //g' | tr -d '\n' | urldecode | |
SETDESC ${1:-Please enter the passphrase for your SSH key} | |
GETPIN | |
EOM | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment