ecryptfs is not installed by default in Ubuntu 18.04 (as already mentioned in this AU question).

When I installed ecryptfs via apt-get everything seemed to work fine at first. But after a reboot I get the following error when using ecryptfs-mount-private:

mount: No such file or directory

Any idea how to fix this problem?
It seems to be solved in Linux Mint 19 Tara.


With Ubunutu 18.04 and lightdm / systemd (the GUI login screen) there is something broken wrt Kernel keyring (as of 2018 Sept). This breaks some functionality in the ecryptfs scripts, which make use of the session key-ring.

After logging into your account via the GUI (lightdm), you will notice that your session keyring is not initialized correctly:

keyctl show

There are several work-arounds to this. One was noted by @serg-tt which uses a Linux Console login.

To fix this bug, and get the default user session keyring applied after a GUI login, I put a (temporary) fix by adding a file:


The contents of this file:

# Work around a bug in lightdm and/or systemd that leaves
# an incorrect session keyring (a root owned keyring)
# applied. I think this supposed to be fixed in pam
# by pam_keyinit.so, however, it does not seem to be
# working.

# Try and use the default session keyring for the user:
[ "$UID" ] || UID=`id -u`
## keyctl show > /tmp/fix-keyring$$ #DEBUG

STARTUP="keyctl session $keyringname $STARTUP"

After applying this fix, you would need to log out and log back in again.

  • Thanks for your suggestion Gregor. I setup this script and it seems to work after logout and log back in. But when I restart the pc it doesn't seem to work even though the script is executed. – user870424 Sep 29 '18 at 10:17
  • 1
    I have to correct my last post: it works! Even after a reboot but I had to disable auto login. Thanks again! – user870424 Sep 29 '18 at 14:48

ecryptfs-mount-private is a relatively short (65 lines without comments) shell script, but the only mount call is to mount.ecryptfs_private, and it requires the following files/directories, are they all there?

  • $HOME/.Private as the SOURCE
  • $HOME/Private as the DESTINATION
  • $HOME/.ecryptfs/Private.sig for the key signatures.
  • $HOME/.ecryptfs/wrapped-passphrase

"No such directory" sounds like you're missing ~/Private or ~/.Private. Maybe ecryptfs-setup-private wasn't entirely successful? You could step through it one line at a time if you wanted to, this command lets you see it:

less `which ecryptfs-setup-private`
  • All directories and files are present. What is really strange: When I try the command 5 or 10 ten times it eventually works! But after a reboot I have to do the same again – user870424 Sep 13 '18 at 10:14
  • Is it only the mount.ecryptfs_private... line that needs repeating 10 times until it works? That sounds a lot like a bug... – Xen2050 Sep 14 '18 at 2:30
  • yes, either this or the ecrypt-setup-private script. I'm sure it is a bug. I've read that ecryptfs has some problems with systemd. I wonder if this was solved in other distributions like Linux Mint 19 Tara. – user870424 Sep 14 '18 at 20:49

The cryptfs's mount doesn't work on GUI(through shortcut "Access-Your-Private-Data.desktop" or terminal ) .

Little workaround is: you have to exec command mount:
$ ecryptfs-mount-private
on any tty (Ctrl F(3-6)), {Ctrl (F2-1) will back you to your GUI session} or ssh...
profit )

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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