Last active
April 2, 2018 08:58
-
-
Save cirias/5e179b6ce5ad3f7675bcd32f5526aa9c to your computer and use it in GitHub Desktop.
SSH using GPG on Ubuntu 17.10
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
cat > ~/.gnupg/gpg-agent.conf <<EOF | |
default-cache-ttl 600 | |
max-cache-ttl 7200 | |
enable-ssh-support | |
EOF | |
gpgconf --kill gpg-agent | |
gpg-connect-agent reloadagent /bye | |
# man gpg-agent | |
cat >> ~/.bashrc <<EOF | |
unset SSH_AGENT_PID | |
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then | |
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)" | |
fi | |
EOF | |
gpg-connect-agent updatestartuptty /bye |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment