Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Right now I have gnome-keyring-daemon set to start at login. If I run emacs -q and then open a file on a server using M-x find-file and then enter a file on a remote server such as /ssh:user@server:/home/user/.bashrc, then a GUI pops up and asks for my ssh private key password. I enter the correct password, and the file opens perfectly.

However, if the gnome-keyring-daemon password expires from the keyring, emacs still allows connection to the file without entering the password. For example, let's say I open a remote file, then kill the file with C-x k. Then I go to a terminal and type ssh-add -D. I can verify that this causes the keyring to forget the password by running ssh localhost (the GUI pops up and asks for the password.) But if I try and re-open the remote file in emacs using C-x C-f M-p RET, the file opens without requiring the password.

Running tramp-cleanup-all-connections fixes this issue i.e. the agent will correctly ask for a password if the key is not in the keyring. Setting tramp-persistency-file-name to nil does not seem to change the behavior.

What is an efficient way to fix this problem? Do I run tramp-cleanup-all-connections on some hook? Maybe on a timer? Does running this function have a negative impact on future tramp connections?

  • emacs-version: GNU Emacs 24.3.1
  • tramp-version: 2.2.6-24.3
  • gnome-keyring-daemon --version: 3.2.2
share|improve this question
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.