Our servers are behind a proxy that requires two factor authenticatio. I managed to get through the authentication process yet was wondering, is there a way of authenticating only once and not for each different connection?
Asked
Active
Viewed 353 times
1 Answers
1
Tramp could cache passwords. See variable password-cache-expiry
. Its default value expires cached passwords after 16 seconds.
And/or configure auth-source.el
properly. For example, add respective entries to .authinfo
.
Read the Tramp manual, section "Password handling", for more details.

Michael Albinus
- 6,647
- 14
- 20
-
Thanks for your answer though I'm not sure either of those solutions can solve the issue. The two factor authentication password keep changes on a constant interval period of time therefore saving the password doesn't really helps in this case. I tried it. – Adam May 12 '18 at 20:18
-
Then I need your use case. Do you mean that there is the same password for different targets, you would like to reuse? – Michael Albinus May 13 '18 at 08:43
-
all hosts are behind a single proxy server. In order to login to that server and then multi-hop to the other hosts I must to enter a password that keeps on changing each minute. Thats why saving this password wouldn't help. Is there a way of reusing the connection with the proxy server when connecting to different hosts? – Adam May 14 '18 at 21:37
-
I cannot say it for sure. But if `tramp-use-ssh-controlmaster-options` is set to t, and `tramp-ssh-controlmaster-options` is set to something like `"-o ControlMaster=auto -o ControlPath='tramp.%%C' -o ControlPersist=no"`, it could work. Both variables exist since Emacs 24.1, I believe. – Michael Albinus May 15 '18 at 07:11
-
Thanks again, I tried to use the config you suggested and noticed that this issue only happen when I use the 'sudo' method. If I connect without it it works great and doesn't prompt me for a password login on each connection. – Adam May 19 '18 at 22:22
-
Yes, for the `sudo` method there doesn't exist connection reusing. – Michael Albinus May 20 '18 at 09:10