Move ssh-agent.sock to /var/run/user

Totally forgot about /var/run/user directory. There is already a place
for user specific tempfiles, so better use that one instead.
This commit is contained in:
c47 2024-02-17 09:36:41 +01:00
parent 76b83497a2
commit 875cbef0b9

View file

@ -135,11 +135,7 @@ fi
export PATH=${HOME}/.local/bin:${HOME}/.nix-profile/bin:${PATH}
if [[ ! -d /tmp/ssh-1000 ]]; then
mkdir -m 0700 /tmp/ssh-1000
fi
export SSH_AUTH_SOCK=/tmp/ssh-1000/ssh-agent.sock
export SSH_AUTH_SOCK=/var/run/user/$(echo $UID)/ssh-agent.sock
if [[ ! $(pidof ssh-agent) ]]; then
eval $(ssh-agent -a ${SSH_AUTH_SOCK})