I tried to install eCryptfs on my server to open an eCryptfs I did on my home computer.

I got these errors.

$ sudo mount -t ecryptfs /home/(place)/enc/ /home/(place)/enc/

Unable to get the version number of the kernel module. Please make sure that you have the eCryptfs kernel module loaded, you have sysfs mounted, and the sysfs mount point is in /etc/mtab. This is necessary so that the mount helper knows which kernel options are supported.

Make sure that your system is set up to auto-load your filesystem kernel module on mount.

Enabling passphrase-mode only for now.

Unable to link the KEY_SPEC_USER_KEYRING into the KEY_SPEC_SESSION_KEYRING; there is something wrong with your kernel keyring. Did you build key retention support into your kernel?

I have no idea what that means. My server has Debian on it. Should I do something?


It seems that OpenVZ is the problem (again). OpenVZ uses the parent kernel and I can't do anything with that.

  • If you want to use ecryptfs, you'll need to have it in the kernel. You can use ecryptfs with openvz, but it has to be available in the host kernel, so you'll need your host provider to cooperate. – Gilles Jun 14 '13 at 23:20
  • Yes, unfortunately. Not sure if I should add this to my original question. – Karel Bílek Jun 17 '13 at 21:12

Try commenting out following line in /etc/pam.d/sshd

sessionoptional pam_keyinit.so force revoke

if you comment it out, new virtual sessions should allow ecryptfs mount to work. This worked for me with screen sessions. See this post.

  • Unfortunately it's 2 years later and I no longer have to solve this. – Karel Bílek Jul 7 '15 at 22:25
  • No dice for me on this fix. – Steven McConnon Jul 13 '16 at 19:34

It is possibly because you were trying to mount inside screen or tmux. See: https://bugs.launchpad.net/ubuntu/+source/x2goclient/+bug/1377924

Try just a plain ssh login.

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.