I have passwords stored in .authinfo.gpg file which I only need for Gnus. I never store passwords for machines or localhost in this .authinfo.gpg file (or in any other file).

The problem is when I use Tramp (e.g. C-x C-f, then type in su::), I constantly get prompted for password for .authinfo.gpg which I don't need.

Is it possible to disable password prompt for .authinfo.gpg when using Tramp? An alternative solution would be to use some other file for Gnus, is there a way to do this?


You can either use this (I base mine on the command-line arguments):

(setq tzz-gnus-running-p (member "gnus" command-line-args))
(setq auth-sources (if tzz-gnus-running-p

or customize tramp-completion-use-auth-sources:

tramp-completion-use-auth-sources is a variable defined in ‘tramp.el’.
Its value is t
Whether to use ‘auth-source-search’ for completion of user and host names.
  • 1
    Setting tramp-completion-use-auth-sources to nil does not work for me. I still get prompted for .authinfo.gpg password each time I try to use tramp with /su::/. – Gleb Dec 4 '20 at 22:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.