To avoid repeated prompts for passwords, consider native caching mechanisms, such as ssh-agent for ssh-like methods, or pageant for plink-like methods.
tramp offers alternatives when native solutions cannot meet the need.
The package auth-source.el, originally developed for No Gnus,
reads passwords from different sources, See auth-source. The default authentication file is
~/.authinfo.gpg, but this can be changed via the variable
A typical entry in the authentication file:
machine melancholia port scp login daniel password geheim
The port can take any tramp method (see Inline methods, see External methods). Omitting port values matches all tramp methods.
t to debug messages.
tramp can cache passwords as entered and reuse when needed for the same user or host name independent of the access method.
password-cache-expiry sets the duration (in seconds) the
passwords are remembered. Passwords are never saved permanently nor
can they extend beyond the lifetime of the current Emacs
nil to disable
nil to disable password caching.
Implementation Note: password caching depends on
password-cache.el package. tramp activates password
caching only if tramp can discover, while Emacs is
loading, the package through