Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server, which i access over ssh. Sometimes i like to run some scripts (some of them in the background) in tmux and then detach it, close the connection and access tmux later.
But unfortunately ecryptfs (or whatever service does that stuff) umounts my home-folder as soon as the ssh-connection is closed. This leads to several errors, because the scripts/deamons want to access some files in my home-folder.

So is there a way to prevent ecryptfs from umounting my home if there is still a (detached) tmux session running?

I know that i could just disable the encryption, but i would rather like to keep it and solve the problem someway else.

share|improve this question
up vote 5 down vote accepted

One possibility is to deactivate automatic umounting:

  1. Go to the directory ~/.ecryptfs.
  2. You should find a file auto-umount there.
  3. Remove this file and your ECryptFS-folder will not be umonted at logout.

If you want to do it only at an existing tmux session, I'd suggest writing a small script:


if tmux has 2> /dev/null; then
  touch ~/.ecryptfs/auto-umount
  rm ~/.ecryptfs/auto-umount

If there is an tmux session the script deletes the auto-umount and if not it touches it. Place that script in your shell .logout file.

share|improve this answer
The script doesn't seem to work (i put it into the .bash_logout). But removing the ~/.ecryptfs/auto-umount is good enough for now. – user121839 Jan 13 '13 at 4:28

Your Answer


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

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