Let PAM to provision users on their first login

Ben Lindstrom mouring at offwriting.org
Sun Nov 22 01:12:15 AEDT 2026



> On Nov 20, 2026, at 8:45 PM, Nico Williams <nico at cryptonector.com> wrote:
> 
> On Thu, Nov 19, 2026 at 03:00:36PM -0600, Theo de Raadt wrote:
>> Marco Trevisan <marco at ubuntu.com> wrote:
>>>> I agree.  The proposal is no longer compatible with Unix / POSIX
>>>> properties, and sshd the very last place this kind of thing should
>>>> occur.
> 
> I don't agree with that.  There's no backwards-incompatibility in
> allowing a user account to appear as part of a login attempt that then
> continues to exist thereafter but did not exist before.
> 
> A use-case would be a PAM that lets a user sign-up at the login, much
> like how many web sites do it.  Instead of:
> 
>  Login: ...
>  Password: ...
> 
> one might get:
> 
>  Login (or empty to sign up):
>  Email address: joe at six.pack
>  Enter confirmation code: 012345
>  Enter new password: ************
>  Enter new password again: ************
>  Welcome!
> 
> What might be incompatible is that an account appears not to exist
> unless the user logs in, because then `ls -l` will not resolve UIDs of
> local files they use.  But one could quibble about that.


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.

Why isn’t this the solution we’re talking about?

- Ben


More information about the openssh-unix-dev mailing list