Web lists-archives.com

Re: problems with manual page usermod.8 and useradd.8

On Thu, Feb 22, 2018 at 05:09:34PM -0500, Roberto C. Sánchez wrote:
> I have seen this used on old UNIX or BSD systems to create a second root
> account. For example, the standard default root account is set to use
> some old sh or csh implementation. Somebody installs bash (probably in
> /usr/local) and wants to be able to log in as root and have that be the
> default shell. However it might be dangerous to change root's default
> shell, so you create a second account called 'toor' with user ID 0 and
> the same home directory as root and set its default shell to
> /usr/local/bin/bash (or whatever). Then administrators are able to log
> in as 'toor' to get bash as the default shell.

I've seen variants of this as well, but usually you do it by running vipw
to edit the passwd file (or its BSD equivalent) directly.  Who's got
time to waste learning a bunch of obscure useradd or usermod options? :)

(Seriously, I believe the actual purpose of useradd/usermod is for
package post-install commands, not human use.  Humans can just edit
the file manually.  Plus you get to clean up the ordering of the UIDs
and such while you're in there.)