Let PAM to provision users on their first login
Marco Trevisan
marco at ubuntu.com
Tue Nov 24 04:13:55 AEDT 2026
> Historical perspective… Back in the early 90s when I was in college
> there were a bunch of telnet BBSes popping up as they were cheaper
> (because some could host or access them at their schools) than
> dialup. The general policy use to be to do:
>
> Login: newuser
> Password: <enter>
> .. New user process ..
>
> Then it would kick you out and you’d login normally. So this has
> been done in the past with a real account and custom user shell.
>
>
> However, as for NSS not knowing the UID before PAM starts. Didn’t
> Google solve this problem by providing a custom NSS module that
> intercepts and send the request to their metadata server and if all
> is good their PAM then module pulls the rest of the information and
> populates the password file? I believe this is done in their
> compute-image-packages infrastructure.
We do use a NSS module that does something similar [1], but the
metadata server only provides information to authenticated users
and we can't do earlier than that.
So what we do is exposing a temporary user that eventually will
be associated with the real one if authentication succeed.
But this is not something you really expect to do in a setup where
you have PAM (or any other mechanism) that should do the user auth
and that may NOT have the user information until the authentication
flow is completed.
[1]
https://github.com/canonical/authd/blob/3e475d28/nss/src/passwd/mod.rs#L185-L188
More information about the openssh-unix-dev
mailing list