tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tramp access to ssh agent


From: Michael Albinus
Subject: Re: tramp access to ssh agent
Date: Sun, 16 Oct 2022 20:45:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

GUEZ Lionel <guez@lmd.ipsl.fr> writes:

> Hello.

Hi Lionel,

> I am using GNU Emacs 27.1 on Linux Mint 21. I am experiencing a
> problem that I did not have with my previous setup: Emacs 26.3 on
> Linux Mint 20.3. I have an SSH key, protected by a passphrase, that I
> use to connect to a remote host. As the key is in my .ssh directory
> with a standard name, it is automatically detected and unlocked at
> login by gnome-keyring-daemon. So when I ssh to the remote host from a
> terminal, the ssh agent provides the passphrase and I do not have to
> enter it.
>
> Now here is the strange part. When I try to connect to the
> remote host from Emacs, Emacs may or may not ask me the passphrase. It
> seems to depend on how long ago I logged in. If I try the connection
> in Emacs immediately after login, Emacs does not ask me the
> passphrase, and Emacs never asks the passphrase from then on in this
> session. If I try the connection in Emacs for the first time in my
> session, say, a few hours after login, Emacs asks me the passphrase. So
> it seems that tramp has access to the ssh agent or not depending on how
> long has elapsed since login. Note that there is no such problem from
> the Gnome terminal. Even when Emacs asks me the passphrase, the
> terminal does not. The ssh agent is here (I see it in the list of
> processes) and the terminal has access to it.
>
> Does anybody understand this? Is there a timeout period after which
> gnome-keyring is not able to communicate with Emacs? And why is this
> different in Linux Mint 20.3 and 21?

I'm not aware that Tramp (or Emacs in general) is fiddling with
this. The SSH agent is found by the environment variable SSH_AUTH_SOCK I
believe, which is /run/user/1000/keyring/ssh in my local environment
(Fedora 16). Can you check that this env variable is set in case it
works for you, and it is not set when it doesn't work? You might check
the Lisp variable `process-environment', which contains all such
variables.

Another difference between Emacs 26 and 27 is, that Tramp saves
validated passwords / passphrases. Does Emacs ask you to save the
passphrase? Is there an entry in ~/.authinfo.gpg (or whatever you use
for auth-sources), which is related to the passphrase?

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]