TGViewer
/r/emacs /r/emacs @r_emacs · 81 subscribers
Post #28661 13
Caching ssh passphrase with Magit?

I can't seem to get this working so i'm wondering how other people are doing this. I have ssh-agent running through a Guix home service, and in my .ssh/config i have this:

Host *
AddKeysToAgent yes

This works just fine if i perform a git action like committing or pushing in the terminal, the password stays cached and it doesn't prompt me again. In Emacs with Magit however, it keeps prompting me for the password every time, and running `ssh-add -l` shows that the ssh key does not get added to the agent. This is confusing to me cause Magit is just a front-end and still uses Git in the background right? Emacs also has `SSH_AUTH_SOCK` set correctly (it doesn't have the PID variable though, but my terminal doesn't seem to have that set either and yet it works just fine with Git in the terminal). I've looked at thing like ssh-agency, but i'm not sure if i should be using that, cause i'm not sure if that tries to start its own instance of ssh-agent, which i don't want since i'm already managing that with a Guix service. Since i don't want to be prompted on each login either since i don't always need to use my ssh keys, the only thing i can think of for now is to manually add the keys with `ssh-add` before i start doing my git actions in Magit, but there must be a better way to go about this right?

https://redd.it/1wxouel
@r_emacs
Reddit From the emacs community on Reddit Explore this post and more from the emacs community
More from @r_emacs
  1. Oct 8, 2026Emacs on Windows 11 Arm64 I got myself an Asus Zenbook A16 and it has been a really great…
  2. Oct 8, 2026Hyperbole HyRolo: Search, Retrieve and Insert Records, Not Lines https://www.chiply.dev/po…
  3. Oct 8, 2026NEW emacs32 master branch support scaling for underline, overline... face Related email di…
  4. Oct 8, 2026Fixing the tree-sitter syntax highlighting bug in Emacs 31+ indirect buffers (The Emacs ma…
  5. Oct 8, 2026need to repeatedly resolve a complete neighboring face here, or could it reuse information…
  6. Oct 8, 2026makes a measurable difference The experimental change is deliberately narrow. It remembers…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →