Let PAM to provision users on their first login
Klaus Ethgen
Klaus+ssh at ethgen.ch
Fri Nov 20 08:14:50 AEDT 2026
Am Do den 19. Nov 2026 um 0:43 schrieb Marco Trevisan:
> On each user login attempt, sshd looks the user up via NSS before
> authentication, and if the user does not exist it marks the login
> as invalid: the real password is replaced by a fake one, PAM success
> is treated as an internal error, and the login can never succeed.
And that is good that way.
> This prevents PAM modules that create the account as part of the
> authentication from working over SSH.
>
> 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.
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!
Gruß
Klaus
--
Klaus Ethgen http://www.ethgen.ch/
pub 4096R/4E20AF1C 2011-05-16 Klaus Ethgen <Klaus at Ethgen.ch>
Fingerprint: 85D4 CA42 952C 949B 1753 62B3 79D0 B06F 4E20 AF1C
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 728 bytes
Desc: not available
URL: <http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20261119/6d9965ee/attachment.asc>
More information about the openssh-unix-dev
mailing list