Let PAM to provision users on their first login
Theo de Raadt
deraadt at openbsd.org
Fri Nov 20 08:00:36 AEDT 2026
Marco Trevisan <marco at ubuntu.com> wrote:
> >> The "monitor: Receive PAM account requests only after authentication"
> >> bit is good though and mirrors a hardening that I've wanted to do for
> >> a while.
> >
> >
> > I agree. The proposal is no longer compatible with Unix / POSIX
> > properties, and sshd the very last place this kind of thing should
> > occur.
>
> It's unclear to me what you mean here. What is not-compatible?
In all traditional unix systems, a uid is already assigned to (at least one)
name entry.
Furthermore in 99% of Linux systems today, the uid is already assigned
in the same classic way.
So what you are describing is a new behaviour. We are on the same page,
right?
> > Outside of the sshd context, I think the Ubuntu design is extremely
> > dangerous and in time there will be interesting consequences.
>
> What we did is mostly because the SSH behavior is not complying with any
> other UNIX tool out there, as it requires user accounts to exist ahead
> of
> time, while that's against any NSS design out there IMHO.
Most unix systems do not use NSS, let alone this extension you are
talking about.
NSS is not in POSIX. NSS is not a part of Unix. It exists in a
fraction of the variety of system that OpenSSH runs on.
> What we did in our NSS module is of course not great because it makes
> way more complex something that should be just work, but the way it's
> designed did not outline major issues so far. Hoping that will continue.
Then we come to that you've made custom changes to NSS, which did not
exist.. until recently, right?
What you did in your NSS is very unlike tranditional Unix, and I believe
this friction you encounter here is only the beginning of a long story.
I do not believe you'll be able to account for all the consequences in
applications ahead of time.
However, just thinking of OpenSSH. It must continue run on a large
variety of systems, and it does not need to bend over backwards to
support such extremely weird new situations. We have similar
circumstances with other vendors who have different behaviours -- like
Microsoft, Apple, Cisco routers/switches, and I believe it is impossible
for the small OpenSSH team to handle all these weird behaviours in a
competent fashion without breaking something else, so I am convinced
this change you made must remain your own problem to solve.
More information about the openssh-unix-dev
mailing list