fix emacs client not using ssh keys with magit and tramp
NapoleonWils0n
emacs client not working with your ssh keys with programs like magit and tramp even though you have added your ssh keys and its working with emacs
The problem may be how you have started using emacs --daemon in your window manager or systemd
The issue is the emacsclient needs to be able access the SSH_AUTH_SOCK variable from the parent process that contains the path to the ssh-agent socket that is created when you use ssh-add
The fix to get emacsclient to use your ssh keys is to start emacs using the emacsclient in your desktop application launcher like rofi, this starts the emacs daemon and allows the emacsclient to access the ssh variable for the ssh keys
Dont start emacs using systemd because it doesnt use variables set in your shell config files, and starting emacs with emacs --daemon in your window manger sets the parent process to your window manager
So the short answer is starting emacs with emacsclient using your desktop launcher fixes the issue of emacsclient not using your ssh keys ... https://www.youtube.com/watch?v=HXDU3Zmmb_k
70641910 Bytes