0

When I invoke crux-sudo-edit, Emacs hangs forever with the following message:

Decrypting /home/$USER/.authinfo.gpg...0%

until I press C-g, then it asks:

Passphrase for symmetric encryption for /home/$USER/.authinfo.gpg:

(When finding a file with "/sudo::/path/to/file/", Emacs doesn't hang but still want to decrypt my ~/.authinfo.gpg)

Because I don't save my root password there, I press another "C-g", but annoyingly another window shows up:

Error while decrypting with "/usr/bin/gpg2":

gpg: error creating keybox '/home/$USER/.gnupg/pubring.kbx': No such file or directory
gpg: keyblock resource '/home/$USER/.gnupg/pubring.kbx': No such file or directory
gpg: AES.CFB encrypted data

And it doesn't disappear even after supplying my root password.

Setting tramp-completion-use-auth-sources to nil doesn't solve this.

This problem only appears after creating "~/.authinfo.gpg".

Edit: thank to TRAMP's maintainer's suggestion below, I have come to stricter solution that only disables auth-sources for local sudos, leaving other remote uses (mostly?) intact:

 (connection-local-set-profile-variables
  'remote-without-auth-sources
  '((auth-sources . nil)))

 (connection-local-set-profiles
  '(:application tramp :protocol "sudo"
    :user "root" :machine "localhost")
  'remote-without-auth-sources)
Daanturo
  • 180
  • 8

1 Answers1

2

This is the same question as discussed in https://debbugs.gnu.org/46674 In short: Use Tramp 2.5 from GNU ELPA, and apply in your .emacs

(connection-local-set-profile-variables
 'remote-without-auth-sources '((auth-sources . nil)))

(connection-local-set-profiles
 '(:application tramp) 'remote-without-auth-sources)
Michael Albinus
  • 6,647
  • 14
  • 20
  • But TRAMP 2.5.0.2 seems to be broken. I keep getting `void function tramp-register-crypt-file-name-handler`, had to manually autoload it from `tramp-crypt` to work properly. The cause as I inspected was `defun tramp-register-crypt-file-name-handler` is wrapped inside a `progn` so it's not properly autoloaded. – Daanturo Mar 23 '21 at 14:18
  • The wrapping with `progn` is intended. Could you please show the problem on the `tramp-devel@gnu.org` mailing list? This is better suited for debugging. – Michael Albinus Mar 23 '21 at 14:41