0

I am a happy user of Debian/stable. From my running gnome session I can do all ssh operation (eg. git) without entering my ssh passphrase.

However it stops working whenever I try to ssh to my running box. How can I setup my ssh session to use the running gnome-keyring as ssh-agent ?

$ ssh localhost
$ git remote update
Enter passphrase for key '/home/user/.ssh/acme_id_rsa': 

The following solutions did not work for me:

The upstream documentation does not list this scenario:

I tried also:

$ ssh localhost
$ ssh-add
Could not open a connection to your authentication agent.

I tried following suggestion from:

So I did:

$ sudo apt-get install keychain
$ cat .zprofile 
eval `keychain --eval --agents ssh acme_id_rsa`

But then when connecting from ssh session it still ask for my passphrase:

$ ssh localhost
[...]
 * keychain 2.8.5 ~ http://www.funtoo.org
 * Found existing ssh-agent: 19438
 * Adding 1 ssh key(s): /home/user/.ssh/acme_id_rsa
Enter passphrase for /home/user/.ssh/acme_id_rsa: 
malat
  • 2,708
  • 4
  • 27
  • 47
  • My work laptop is Win10, and I need from time to time to ssh to my linux debian system. `ssh localhost` was for the demo within a single system. – malat Apr 30 '21 at 09:11

1 Answers1

0

One simple solution listed at (and repeated by Stephen Kitt):

is working for me. So at least the symptoms are fixed for me. But technically I am not exactly re-using gnome-keyring so the original question remains.

In case that helps someone else, I can now ssh from my Win10 laptop using:

$ ssh -A linux_server

Which can be saved as:

$ cat .ssh/config
Host linux_server
  ForwardAgent yes
malat
  • 2,708
  • 4
  • 27
  • 47
  • 1
    This isn’t quite what you’re asking for: it forwards SSH agent connections to your *laptop*, not to the GNOME keyring running on your desktop. If both agents have the same keys, the end result will be the same, but that’s a big assumption (and not great security practice AFAIK). – Stephen Kitt Apr 30 '21 at 09:24
  • I leave my answer as potiential solution to fix the symptoms, thanks for the clarification. – malat Apr 30 '21 at 09:26