2

I have an SSH key that I use almost every day and I recently noticed that I haven't had to unlock it in a long while. I don't always shut down my computer and so it is fairly common that ssh-agent is already running when I access a server. But I've now confirmed that actually I'm never being asked for a password.

I feel a little bit like I've lost my mind, because ...

  • ps aux | grep agent doesn't show ssh-agent running.
  • ssh-keygen -y asks for a password but the password I expect doesn't work.
  • ssh user@example.com connects immediately.

There's nothing especially sensitive at stake right now, though that's temporary.

What should I be looking for here? How is my key working without a passphrase, even after a restart? I'm assuming I did something here, but how can I figure out what I did?

Per the comments, I did run echo $SSH_AUTH_SOCK and I see /run/user/1000/keyring/ssh -- lsof /run/user/1000/keyring/ssh isn't returning anything, though, so I don't know what is opening it.

How do I ensure that my key isn't just hanging out unlocked?

  • 1
    There are other things which can act as an ssh agent. Do echo $SSH_AUTH_SOCK and you can see if you have one. An lsof on it will tell you what is providing it. – Patrick Feb 16 '18 at 3:57
  • I see /run/user/1000/keyring/ssh when I do that--but lsof | grep ssh isn't turning up anything. – Amanda Feb 16 '18 at 4:21
  • 4
    no grep, just lsof. Though judging from the path, I suspect it's gnome-keyring-daemon. – Patrick Feb 16 '18 at 4:23
  • Straight lsof gets me 11,000 lines though. – Amanda Feb 16 '18 at 4:34
  • lsof on the file. E.G. lsof /run/user/1000/keyring/ssh – Patrick Feb 16 '18 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.