Code: Select all
#%PAM-1.0
auth optional pam_env.so
auth include system-auth
auth required pam_nologin.so
auth optional /lib/security/pam_mount.so use_first_pass
account include system-auth
password include system-auth
session include system-auth
session optional /lib/security/pam_mount.so/etc/pam.d/system-auth is the normal gentoo default:Dec 6 21:37:00 duck gdm[10198]: pam_mount: error trying to retrieve authtok from auth code
Code: Select all
#%PAM-1.0
auth required pam_env.so
auth sufficient pam_unix.so likeauth nullok
auth required pam_deny.so
account required pam_unix.so
password required pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password sufficient pam_unix.so nullok md5 shadow use_authtok
password required pam_deny.so
session required pam_limits.so
session required pam_unix.so
You're right that the keyfile can be retrieved, but that's why it's encrypted with your (hashed) passphrase! You could also let pam_mount use your login password as dm-crypt passphrase. But in this case you could only change your login password if you also reencrypt the entire partition. That's why this master key is necessary. To sum it up, your login password is always the weakest link.dkey wrote:great howto! but, what about live cds? when I have physical access to the computer, I can boot a live cd and get the keyfile, or?

Code: Select all
# /etc/pam.d/login
#%PAM-1.0
auth required /lib/security/pam_securetty.so
auth required /lib/security/pam_stack.so service=system-auth
auth required /lib/security/pam_nologin.so
auth optional /lib/security/pam_mount.so use_first_pass
account required /lib/security/pam_stack.so service=system-auth
password required /lib/security/pam_stack.so service=system-auth
session required /lib/security/pam_stack.so service=system-auth
session optional /lib/security/pam_mount.soCode: Select all
# /etc/pam.d/kde
#%PAM-1.0
auth required /lib/security/pam_stack.so service=system-auth
auth required pam_nologin.so
auth optional /lib/security/pam_mount.so use_first_pass
account include system-auth
password include system-auth
session include system-auth
session optional /lib/security/pam_mount.soCode: Select all
auth optional pam_mount.so use_first_passCode: Select all
session optional pam_mount.so
Code: Select all
# Note that pam_mount is LUKS (http://luks.endorphin.org) aware. To
# use luks, you need to have cryptsetup-luks (get it at
# http://luks.endorphin.org/dm-cryp) installed. A config line would be
#volume user1 crypt - /dev/yourpartition /yourmountpoint - - -
# and cryptsetup will be told to read cypher/keysize/etc. from the luks-header.
but of course every passwdehd an old version is store in key.old. Shouldn't the old encrypted key file be deleted afterwards?..an old version of your encrypted master key could still be recovered after you've used passwdehd

Where should I add this sleep 1? I noticed that I can umount myself after logout from kde is finished.tuxophil wrote:Yes, I should have added some lines about that problem. In fact there are still some processes left when you leave KDE, but only for a few ms. Adding a one second sleep to umount.crypt solves this problem. This should be more elegant.
Code: Select all
cryptumount 'sleep 5 && /usr/bin/umount.crypt %(MNTPT)'Code: Select all
pam_mount: command: /usr/bin/umount.crypt [/home]
I don't think so, get the message pam_mount: Unknown Config-Option: cryptumount'. umount.crypt is used anyway according to the debug text.Guschtel wrote:cryptumount /usr/bin/umount.crypt %(MNTPT)
Code: Select all
X Window System Version 6.8.2
Release Date: 9 February 2005
X Protocol Version 11, Revision 0, Release 6.8.2
Build Operating System: Linux 2.6.15-gentoo i686 [ELF]
Current Operating System: Linux stingray 2.6.15-gentoo-r4 #1 PREEMPT Tue Feb 7 23:54:29 CET 2006 i686
Build Date: 20 January 2006
Before reporting problems, check http://wiki.X.Org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Wed Feb 8 01:07:16 2006
(==) Using config file: "/etc/X11/xorg.conf"
Using vt 7
pam_mount: pam_sm_open_session args: use_first_pass
pam_mount: saving authtok for session code
xdm error (pid 9397): Unknown session exit code 2816 from process 9405
Code: Select all
auth required pam_stack.so service=system-auth
auth required pam_nologin.so
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth
session required pam_stack.so service=system-auth
session optional pam_console.so
auth optional /lib/security/pam_mount.so use_first_pass
session optional /lib/security/pam_mount.so
Yes, your right.paoleela wrote:I don't think so, get the message pam_mount: Unknown Config-Option: cryptumount'. umount.crypt is used anyway according to the debug text.Guschtel wrote:cryptumount /usr/bin/umount.crypt %(MNTPT)

Code: Select all
echo $KEY | cryptsetup -h sha256 create secure_disk /dev/hda7
Command failed: Invalid argument
Code: Select all
Jun 26 11:45:27 xxx login(pam_unix)[2989]: session opened for user xxx by (uid=0)
Jun 26 11:45:27 xxx login[2989]: pam_mount: reading options_allow...
Jun 26 11:45:27 xxx login[2989]: pam_mount: reading options_require...
Jun 26 11:45:27 xxx login[2989]: pam_mount: back from global readconfig
Jun 26 11:45:27 xxx login[2989]: pam_mount: per-user configurations not allowed by pam_mount.conf
Jun 26 11:45:27 xxx login[2989]: pam_mount: real and effective user ID are 0 and 0.
Jun 26 11:45:27 xxx login[2989]: pam_mount: checking sanity of volume record (/dev/sda5)
Jun 26 11:45:27 xxx login[2989]: pam_mount: about to perform mount operations
Jun 26 11:45:27 xxx login[2989]: pam_mount: information for mount:
Jun 26 11:45:27 xxx login[2989]: pam_mount: --------
Jun 26 11:45:27 xxx login[2989]: pam_mount: (defined by globalconf)
Jun 26 11:45:27 xxx login[2989]: pam_mount: user: xxx
Jun 26 11:45:27 xxx login[2989]: pam_mount: server:
Jun 26 11:45:27 xxx login[2989]: pam_mount: volume: /dev/sda5
Jun 26 11:45:27 xxx login[2989]: pam_mount: mountpoint: /home/xxx
Jun 26 11:45:27 xxx login[2989]: pam_mount: options: cipher=aes
Jun 26 11:45:27 xxx login[2989]: pam_mount: fs_key_cipher: aes-256-ecb
Jun 26 11:45:27 xxx login[2989]: pam_mount: fs_key_path: /home/xxx/xxx.key
Jun 26 11:45:27 xxx login[2989]: pam_mount: use_fstab: 0
Jun 26 11:45:27 xxx login[2989]: pam_mount: --------
Jun 26 11:45:27 xxx login[2989]: pam_mount: checking to see if /dev/mapper/_dev_sda5 is already mounted at /home/xxx
Jun 26 11:45:27 xxx login[2989]: pam_mount: checking for encrypted filesystem key configuration
Jun 26 11:45:27 xxx login[2989]: pam_mount: decrypting FS key using system auth. token and aes-256-ecb
Jun 26 11:45:27 xxx login[2989]: pam_mount: error getting cipher "aes-256-ecb"
Jun 26 11:45:27 xxx login[2989]: pam_mount: mount of /dev/sda5 failed
Jun 26 11:45:27 xxx login[2989]: pam_mount: clean system authtok (0)
Jun 26 11:45:27 xxx login[2989]: pam_mount: command: /usr/sbin/pmvarrun [-u] [xxx] [-d] [-o] [1]
Jun 26 11:45:27 xxx login[2989]: pam_mount: pmvarrun says login count is 2
Jun 26 11:45:27 xxx login[2989]: pam_mount: done opening session