Use ssh-agent instead og gpg-agent for SSH

This commit is contained in:
Sam A. 2023-03-14 15:25:23 +01:00
parent 865d5fcd2a
commit 0deeea5b74
Signed by: samsapti
GPG Key ID: CBBBE7371E81C4EA
3 changed files with 6 additions and 1 deletions

View File

@ -27,6 +27,10 @@ get_ip() {
eval "curl ${ARGS[@]} -fsSL 'https://ifconfig.co/json$IP' $JQ"
}
gpg_ssh() {
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
}
http() {
(( ${+commands[python]} )) || return 2
[[ $# -gt 0 ]] && local DIR="--directory=$1" && shift

View File

@ -1,6 +1,5 @@
if [[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]]; then
export GPG_TTY="$TTY"
export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
gpgconf --launch gpg-agent
gpg-connect-agent updatestartuptty /bye &> /dev/null
fi

2
zsh/.config/zsh/ssh.zsh Normal file
View File

@ -0,0 +1,2 @@
[[ -z $SSH_CONNECTION ]] && [[ $HOSTNAME != "toolbox" ]] &&
eval "$(ssh-agent)" &> /dev/null