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:
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
# 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.