]> git.ipfire.org Git - thirdparty/systemd.git/commit
pam_systemd_home: in ssh logins and similar, ask via fallback shall for home password
authorLennart Poettering <lennart@poettering.net>
Mon, 27 Nov 2023 22:00:12 +0000 (23:00 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 14 Feb 2024 14:06:20 +0000 (15:06 +0100)
commit2518230d33691b96d6dbe2c8bb4289776c23e1eb
tree12b851226c83b4158764efe5b0134201b3941617
parent49493a7478f50113482d9d3f075fb75f0730096c
pam_systemd_home: in ssh logins and similar, ask via fallback shall for home password

ssh runs PAM session hooks before they allocate a pty for the session.
(That's because they allow multiplexed connections, and hence might run
multiple ptys over the same same session). This means PAM modules cannot
interactively ask the user for additional information as they deem fit.
That's a problem for us, since generally during an SSH login no
authentication token (aka "password") is supplied to us which we could
use to unlock the user's home dir.

With this commit we implement a way out: we allow the login to proceed,
but without the home dir activated, and then override the user's shell
with our fallback shell, which will ask for the user's password and then
chainload the actual shell.

This will of course only work if the login actually involves invoking
the configured interactive shell of the user. For other logins (such as
sftp or so), this cannot work, and they'll see an empty home dir
instead.
src/home/pam_systemd_home.c