I am trying to setup git so it wont keep asking for me for passphrase when I do git push/pull etc.
I use kernel: 6.9.3-3-MANJARO
Cinnamon: 6.0.4
cat ~/.ssh/config
Host *
AddKeysToAgent yes
.zshrc:
if [ -f ~/.ssh/id_rsa ]; then # Check if key file exists
if [ -z "$SSH_AUTH_SOCK" ] ; then # Check if agent is not running
eval "$(ssh-agent -s)" # Start the agent
ssh-add ~/.ssh/id_rsa # Add your key
fi
fi
I think previously on ubuntu I was using keyring for that, but I configured it so long time ago that I dont remember, I have fresh manjaro install.
Or use a keyring. I recommend gnome-keyring-daemon and gcr.
If you’re using cinnamon, I guess that gnome-keyring-daemon is already installed. Also, I guess gcr is also installed, so you only need to activate this daemon: systemctl --user enable --now gcr-ssh-agent.service
Then, you remove your snippet from the .zshrc file and add this: export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR}/gcr/ssh"
If other programs should be able to use this key, then put this line into ~/.xprofile instead.
You should reboot afterwards and check if it works.