From 9745c72c34f562fd422ec3d6afb9600fdf603dd3 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Tue, 28 Feb 2017 09:19:18 +0800 Subject: profile: Start gpg-agent and use it for SSH Credit: https://wiki.archlinux.org/index.php/GnuPG --- _profile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/_profile b/_profile index 237a91c..9eda66f 100644 --- a/_profile +++ b/_profile @@ -86,3 +86,14 @@ export LESS="--ignore-case --raw-control-chars" if _exists dircolors; then eval $(dircolors -b) fi + +## gpg-agent: start it if not running +if ! _running gpg-agent; then + gpg-connect-agent /bye &> /dev/null +fi + +## Set SSH to use 'gpg-agent' +unset SSH_AGENT_PID +if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then + export SSH_AUTH_SOCK="/run/user/${UID}/gnupg/S.gpg-agent.ssh" +fi -- cgit v1.2.2