The cache expiry
(setq password-cache-expiry nil)
works only for the livetime of the emacs client. But I found in the Tramp user manual the possibility to store passwords permanently
5.12.1 Using an authentication file
The package auth-source.el, originally developed in No Gnus, offers the possibility to read passwords from a file, like FTP does it from
~/.netrc
. The default authentication file is~/.authinfo.gpg
, this can be changed via the variableauth-sources
. A typical entry in the authentication file would bemachine melancholia port scp login daniel password geheim
How do I setup this permanent password storage?
~/.ssh/config
file to store connection settings. Note that using passwords for SSH connection is generally not advisable since asymmetric cryptography provides much better protection. The only valid uses could be if you connect to a machine with no internet access or similar cases when security doesn't matter. – wvxvw Feb 2 '15 at 8:59