I'm asked far too often for my sudo password by TRAMP.

  • You can add you sudo password to authinfo.gpg. Add the following line machine localhost login root port sudo password SECRET.
    – aadcg
    May 16, 2022 at 8:43
  • 1
    The comment above is true for Tramp 2.5 (part of Emacs 28) and earlier. In Tramp 2.6, you need an entry like machine localhost login USER port sudo password SECRET, with USER being your local user name.. May 16, 2022 at 11:16

1 Answer 1


TRAMP only asks for the password when sudo requires it to ask. If you want to configure how sudo works, then read the manual page for sudo.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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