Created
September 2, 2015 22:39
-
-
Save naftulikay/1b8d480e8d2b8db64ccc to your computer and use it in GitHub Desktop.
GPG agent with SSH support and remote passthrough.
This file contains hidden or 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/bash | |
# ... normal .bashrc stuff | |
# if our gpg agent environment file exists _and_ we're not over SSH | |
if [[ -f "$HOME/.gpg-agent-info" && -z "$SSH_CLIENT" ]]; then | |
# load environment variables to use local gpg agent for gpg and SSH | |
source "$HOME/.gpg-agent-info" | |
export GPG_AGENT_INFO SSH_AUTH_SOCK SSH_AGENT_PID | |
fi | |
# set gpg's tty to the current tty | |
export GPG_TTY="$(tty)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment