Subject: bug#55555: 28.1; Tramp prompting for password even with an existing .authinfo.gpg file

From: Michael Albinus <[email-masked]>
Date: Sat, 21 May 2022 14:51:20 +0200

Thierry Volpiatto <[email-masked]> writes:

Hi Thierry,

> This is not happening up to Emacs-28.1, this starts happening recently
> from emacs-29+.

Do you use a "sudo" connection? There has been a change in the .authinfo
entry, see etc/NEWS from master:

--8<---------------cut here---------------start------------->8---
*** Proper password prompts for methods "doas", "sudo" and "sudoedit".
The password prompts for these methods reflect now the credentials of
the user requesting such a connection, and not of the user who is the
target.  This has always been needed, just the password prompt and the
related 'auth-sources' entry were wrong.
--8<---------------cut here---------------end--------------->8---

And the Tramp manual says

--8<---------------cut here---------------start------------->8---
   For the methods ‘doas’, ‘sudo’ and ‘sudoedit’ the password of the
user requesting the connection is needed, and not the password of the
target user.  If these connections happen on the local host, an entry
with the local user and local host is used:

     machine HOST port sudo login USER password secret
--8<---------------cut here---------------end--------------->8---

> It asks also to save password in authinfo file when entering password.
> Really annoying.

See the Tramp manual:

--8<---------------cut here---------------start------------->8---
   If no proper entry exists, the password is read interactively.
After successful login (verification of the password), Emacs offers to
save a corresponding entry for further use by ‘auth-source’ backends
which support this.  This can be changed by setting the user option
‘auth-source-save-behavior’ to ‘nil’.
--8<---------------cut here---------------end--------------->8---

> Thanks.

Best regards, Michael.