Bug 282070 - pam_zfs_key - miscellaneous issues
Summary: pam_zfs_key - miscellaneous issues
Status: Closed Works As Intended
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 15.0-CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-13 22:56 UTC by Marek Zarychta
Modified: 2024-11-14 17:13 UTC (History)
0 users

See Also:


Attachments
working configuration used for tests on cosole (401 bytes, text/plain)
2024-10-13 23:03 UTC, Marek Zarychta
no flags Details
working configuration (401 bytes, text/plain)
2024-11-14 17:12 UTC, Marek Zarychta
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Zarychta 2024-10-13 22:56:01 UTC
The manual page for pam_zfs_key is missing, so not many people are testing it. I spotted at least 2 flaws in this module:

1. The password has to be typed twice when the module is enabled, console login looks like below

FreeBSD/amd64 (chmura) (ttyu1)

login: mzar
Password:
Password:
Last login: Mon Oct 14 00:36:31 from....

2. If something goes wrong (it's most likely a failed attempt to unload the key), then "3" is written to the file /var/run/pam_zfs_key/$uid which prevents further loading keys until the file gets cleared.

3. I was neither able to configure this module to work with SSH (though the stage of double password typing was achieved) nor with a graphical login manager (tried with x11/slim).

All the tests were done on the most recent stable/14 and/or recent CURRENT.
Comment 1 Marek Zarychta 2024-10-13 23:03:25 UTC
Created attachment 254218 [details]
working configuration used for tests on cosole

Please see working /etc/pam.d/login attached. Similar changes were made to /etc/pam.d/sshd and /usr/local/etc/pam.d/slim.
Comment 2 Marek Zarychta 2024-11-14 17:12:24 UTC
Created attachment 255176 [details]
working configuration

Reordering modules fixed the issue. Now pam_zfs_key works as intended, including X11 auth done by x11/slim (slim pam.d file not included here, but its syntax follows included "login" file).
Comment 3 Marek Zarychta 2024-11-14 17:13:23 UTC
I am closing this PR since everything works as intended.