all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Telling Tramp NOT to use authinfo.gpg
@ 2020-12-04 22:33 Gleb Nemshilov
  2020-12-05  9:03 ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Gleb Nemshilov @ 2020-12-04 22:33 UTC (permalink / raw)
  To: help-gnu-emacs

I use authinfo.gpg file for storing passwrods for Gnus only. This causes Tramp to constantly ask password for .authinfo.gpg.

Is it possible to disable this behaviour?

I tried setting "tramp-completion-use-auth-sources" to nil, but that does not help and I still get prompted for the password each time I use Tramp with something like "/su::/" and pressing Tab.

--
Best regards,
Gleb



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Telling Tramp NOT to use authinfo.gpg
  2020-12-04 22:33 Telling Tramp NOT to use authinfo.gpg Gleb Nemshilov
@ 2020-12-05  9:03 ` Michael Albinus
  2020-12-06 17:53   ` Gleb Nemshilov
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Albinus @ 2020-12-05  9:03 UTC (permalink / raw)
  To: Gleb Nemshilov; +Cc: help-gnu-emacs

"Gleb Nemshilov" <gleb@fastmail.com> writes:

Hi Gleb,

> I use authinfo.gpg file for storing passwrods for Gnus only. This
> causes Tramp to constantly ask password for .authinfo.gpg.
>
> Is it possible to disable this behaviour?
>
> I tried setting "tramp-completion-use-auth-sources" to nil, but that
> does not help and I still get prompted for the password each time I
> use Tramp with something like "/su::/" and pressing Tab.

When nil, this user option disables to use your .authinfo.pgp when
completing host names. So you shall keep it nil.

Disabling .authinfo.gpg for Tramp is not foreseen. The most simple
workaround is to eval after loading tramp.el

(fset #'tramp-read-passwd
      (lambda (key &optional prompt)
	(password-read (or prompt "Password: ") key)))

> Best regards,
> Gleb

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Telling Tramp NOT to use authinfo.gpg
  2020-12-05  9:03 ` Michael Albinus
@ 2020-12-06 17:53   ` Gleb Nemshilov
  2020-12-07  9:43     ` Michael Albinus
  0 siblings, 1 reply; 4+ messages in thread
From: Gleb Nemshilov @ 2020-12-06 17:53 UTC (permalink / raw)
  To: Michael Albinus; +Cc: help-gnu-emacs

Hi Michael!

Thank you, it works perfectly!

However it changes the prompt message and I understand why it happens. The original function has a lot of code, and I couldn't find which part is responsible for the prompt message. Is it possible to get similar behaviour and see the name of the user/host for which I enter the password?

--
Best regards,
Gleb

On Sat, Dec 5, 2020, at 16:03, Michael Albinus wrote:
> "Gleb Nemshilov" <gleb@fastmail.com> writes:
> 
> Hi Gleb,
> 
> > I use authinfo.gpg file for storing passwrods for Gnus only. This
> > causes Tramp to constantly ask password for .authinfo.gpg.
> >
> > Is it possible to disable this behaviour?
> >
> > I tried setting "tramp-completion-use-auth-sources" to nil, but that
> > does not help and I still get prompted for the password each time I
> > use Tramp with something like "/su::/" and pressing Tab.
> 
> When nil, this user option disables to use your .authinfo.pgp when
> completing host names. So you shall keep it nil.
> 
> Disabling .authinfo.gpg for Tramp is not foreseen. The most simple
> workaround is to eval after loading tramp.el
> 
> (fset #'tramp-read-passwd
>       (lambda (key &optional prompt)
> 	(password-read (or prompt "Password: ") key)))
> 
> > Best regards,
> > Gleb
> 
> Best regards, Michael.
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Telling Tramp NOT to use authinfo.gpg
  2020-12-06 17:53   ` Gleb Nemshilov
@ 2020-12-07  9:43     ` Michael Albinus
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Albinus @ 2020-12-07  9:43 UTC (permalink / raw)
  To: Gleb Nemshilov; +Cc: help-gnu-emacs

"Gleb Nemshilov" <gleb@fastmail.com> writes:

> Hi Michael!

Hi Gleb,

> Thank you, it works perfectly!
>
> However it changes the prompt message and I understand why it
> happens. The original function has a lot of code, and I couldn't find
> which part is responsible for the prompt message. Is it possible to
> get similar behaviour and see the name of the user/host for which I
> enter the password?

In that case, it might be better if you use connection-local variables
in order to disable auth-sources for Tramp. Something like this:

--8<---------------cut here---------------start------------->8---
(connection-local-set-profile-variables
 'remote-without-auth-sources '((auth-sources . nil)))

(connection-local-set-profiles
 '(:application tramp) 'remote-without-auth-sources)
--8<---------------cut here---------------end--------------->8---

It seems to work with Emacs 27.1, but not in all cases. You might try
it.

I've applied a patch to Tramp to let it work robustly, for all
backends. Available with Tramp 2.5.0, which is scheduled for end of this
year via GNU ELPA.

> Best regards,
> Gleb

Best regards, Michael.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-07  9:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-04 22:33 Telling Tramp NOT to use authinfo.gpg Gleb Nemshilov
2020-12-05  9:03 ` Michael Albinus
2020-12-06 17:53   ` Gleb Nemshilov
2020-12-07  9:43     ` Michael Albinus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.