Let PAM to provision users on their first login
Marco Trevisan
marco at ubuntu.com
Tue Nov 24 04:49:48 AEDT 2026
>> In Ubuntu we have authd [1], which authenticates users against an
>> identity provider (Entra ID, Google, ...) and creates the local
>> account on first login; other services (directory or cloud identity
>> integrations, on-demand provisioning on servers), relying on samba
>> or SSSD have the same need.
>
> Why don't you just provide nss with the same backend that you do with
> pam? Same way as sssd and samba does.
>
> Either the user exists (and nss and pam both know about that) or it
> does
> not.
The server providing such information won't reveal if the user exists
before it has authenticated, the very same way that you're expected not
to know if a local user exists in sshd until you've gone through the
whole
authentication process.
And SSSD I feel cannot do it for all its backends, and I'm quite sure
that
also samba cannot do it if relying on external servers for user mapping.
> Not that I would like the mentioned providers but this is your
> problem.
>
> Changing ssh to just fulfil a strange corner case is a very bad idea!
All this process it's definitely not a "strange corner case", this is
just
what an OAUTH2-based authentication system would require.
Because you don't have information about the user BEFORE being
authenticated, and having a token to be able to get user information.
Considering that a strange corner case it's at least, curious, given
that
it's what we need to support systems whose users are managed by services
such as Google, Entra-ID or Keycloak...
More information about the openssh-unix-dev
mailing list