Let PAM to provision users on their first login

Marco Trevisan marco at ubuntu.com
Fri Nov 20 08:38:26 AEDT 2026


Hi,

On 19 nov 2026 at 15:03, Theo de Raadt wrote:

> Marco Trevisan <marco at ubuntu.com> wrote:
>
>> On 19 nov 2026 at 14:46, Theo de Raadt wrote:
>>
>>> Marco Trevisan <marco at ubuntu.com> wrote:
>>>
>>>> It's also what any other PAM based authentication system does, it
>>>> never tries to ensure that an account exists as it just may be not
>>>> defined
>>>> yet.
>>>
>>> What software are you talking about here?
>>
>> For example login... It does not require an account to exist.
>
> Do you mean the login command that you have modified to support
> your NSS behaviour?

Absolutely not... The very stock login provided by both
util-linux or shadow does not check any user.

And must not do it, otherwise it would be impossible for
a linux system to support dynamic users or - as said - users that are
managed on other servers such as in the case of AD, SSSD, winbind and
authd now.

>> Same with login managers (gdm of course does not).
>
> All the X login managers used to do getpwnam() before authentication.
> And somewhere along the line that was changed?

Which one you refer to? Because GDM, lightdm, SDDM never did such check.

Maybe stuff like xdm does that without PAM, but not in a pam context.

> I think you'll admit that there are plenty of systems which *DO* 
> require
> the user to exist.

None of the login systems we're using in linux these days do.
In fact the only case we had to handle with special care was sshd.



More information about the openssh-unix-dev mailing list