Red Hat Bugzilla – Bug 3692
Useradd adds users above NIS rules in /etc/passwd
Last modified: 2008-05-01 11:37:50 EDT
I have a server providing NIS information to several
workstations. The /etc/passwd on the server is used to
build the NIS maps. However, I would like to restrict the
users from logging into the server by placing NIS rules
into /etc/passwd above the user entries.
However, /usr/sbin/useradd places new entries above the NIS
rules, allowing the users to log in, and requiring manual
intervention & editing of /etc/passwd.
A sample of what I am talking about:
engroth:x:502:60:Eric N. Groth,,,,:/admin/engroth:/bin/tcsh
jmgray:x:503:60:Jesse M. Gray,,,,:/admin/jmgray:/bin/tcsh
In this case, all users but 'plankers' have /etc/noshell as
their shell (and this works nicely). However, user 'eddie'
was added last, and was placed above the NIS login
restrictions, allowing him to log in to the server. Is this
intended? (if so just tell me to buzz off :-) ).
Thank you, fellows.
This issue has been forwarded to a developer for further review.
This is the way it is supposed to be. The NIS entries are kept the
last ones, since some documented security mechanisms depend on it
(like your overriding of the noshell stuff)
I remember seeing the ame behavior on solaris.