This is useful for folks like me who use auto-login in gnome and don't want unlock gnome-keyring every time during login.
Prerequisites
- LUKS password and gnome-keyring passwords are same.
- Ubuntu 24.04 (Could work in other versions, but I did not test it)
FYI : It will store first password you type. If you make mistake and type password 2nd time it wont work.
- Install required packages ( package keyutils contain command keyctl)
sudo apt install keyutils
- Edit
/etc/crypttab
, adding the optionkeyscript=decrypt_keyctl
:
sudo vi /etc/crypttab
Example -->
dm_crypt-0 UUID=a19571ac-b032-4073-9ad9-a0a72189ca1b none luks,keyscript=decrypt_keyctl
- Edit
/etc/pam.d/common-password
, adding the optionuse_authtok
to the GNOME keyring line
Example -->
password optional pam_gnome_keyring.so use_authtok
- Rebuild initramfs and reboot :
sudo update-initramfs -k all -c
sudo reboot now
After reboot
journalctl -b0 |grep gkr
Apr 10 18:18:03 dell-laptop gdm-autologin][1432]: gkr-pam: stashed password to try later in open session
Apr 10 18:18:04 dell-laptop gdm-autologin][1432]: gkr-pam: unlocked login keyring