Skip to content

Instantly share code, notes, and snippets.

@cirias
Last active April 2, 2018 08:58
Show Gist options
  • Save cirias/5e179b6ce5ad3f7675bcd32f5526aa9c to your computer and use it in GitHub Desktop.
Save cirias/5e179b6ce5ad3f7675bcd32f5526aa9c to your computer and use it in GitHub Desktop.
SSH using GPG on Ubuntu 17.10
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