[TriLUG] Useradd issues [RESOLVED!]

Jeff Bollinger jeff01 at email.unc.edu
Fri Feb 21 10:13:41 EST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ok, I guess I'm responding to myself but I found the answer, in none
other than the man page (of course).  I guess I had glossed over it
earlier when I read it the previous 15 times looking for the answer, but
basically you have to use the -n flag to prevent the system from
creating a group name that's the same as the user name.  The problem was
with useradd and we could not get it to add users to the group 100
(users).  Check out this section of the useradd man page:

- -n            A  group  having  the  same  name as the user being
~              added to the system will  be  created  by  default.
~              This  option  will turn off this Red Hat Linux spe­
~              cific behavior.


Our /etc/default/useradd file was actually working, but I think we
*have* to use the -n flag to override RedHat's default behavior of
created an associated group name with the userid.  SO...when we make new
userids, we need to run the following:

# useradd -m -n <userid>

Jeff

Jeff Bollinger wrote:
| Has anyone seen the error with RedHat 7.3 where when you first run
| 'useradd' to create a default user environment it doesn't save the -g
| (group) option?
|
| By default, when you run useradd followed by the userid, the a new user
| AND a new group are created (usually with the same name).  I ran the
| following:
|
| useradd -D -g 100 -b /export/home -s /sbin/nologin
|
| and that successfully created /etc/defaults/useradd (though there is also
| an identical file called /etc/defaults/useradd- )
|
| However, now when I create a new user account with:
|
| #useradd userid
|
| everything works fine except a new group still gets created, and my new
| user does NOT belong to gid 100 (as specified in the above command and in
| /etc/defaults/useradd).  I can't figure out why everything else works
| except for the -g flag.  Any ideas?
|
| Thanks as always!
| Jeff
|
| _______________________________________________
| TriLUG mailing list
|     http://www.trilug.org/mailman/listinfo/trilug
| TriLUG Organizational FAQ:
|     http://www.trilug.org/~lovelace/faq/TriLUG-faq.html

- --
Jeff Bollinger, CISSP
University of North Carolina
IT Security Analyst
105 Abernethy Hall
mailto: jeff_bollinger at unc dot edu
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE+VkIlvoVlxVBmgsURAglpAJ9ZMT0d9oNVn0ecXEU6uwEwFd8i6gCg1snM
XVDvWV2I86ag4NZnfFv8zS4=
=o7Jh
-----END PGP SIGNATURE-----




More information about the TriLUG mailing list