useradd problem on RedHat linux

Forum: LinuxTotal Replies: 2
Author Content
raja

Dec 21, 2004
9:56 PM EDT
I am facing a problem while executing 'useradd' command to add user on RedHat linux, if there is already a group with same name as user and '-g' option is not used to set primary usergroup.

Details to reproduce issue is as - (1)On RadHat linux system, a usergroup with name "newuser" already exists. (2)Tried to add user with name "newuser" using following command. useradd newuser (3)Got following problem - useradd: group newuser exists - if you want to add this user to that group, use -g

I was hoping to set "newuser" as primary usergroup while executing above command.

Pls let me know any possible workaround for the same.
cr

Dec 22, 2004
11:58 AM EDT
tested on RHL 6.2:

# useradd -g newuser newuser

This overrides that abend.

I'm biased toward saying that this is a feature, not a bug. Here's why:

Red Hat tooling, by default, gives every newly-created user account its own newly-created group. This makes maintaining each user's privacy easier. You can always add the user into other pre-existing groups afterwards as required, but the user by default has no one in their group but themselves.

If you've already got a group 'newuser', it's already got permissions and memberships set up for some particular use. You as admin will want to be aware of that so that you can check the situation yourself (with a sigh of "Good catch!" perhaps) before assigning the new user to a groupname that coincidentally has other members already in it, and thus giving those previous members group-access to the new user's files.

The command at the top of this note overrides that mechanism by assigning the new user to the (previously existing) group explicitly. Presumably you have investigated and are sure that you know what you're doing by then.

--cr
haivt

Dec 22, 2004
5:14 PM EDT
I. Requirements & Brief job description

* GUI Development in QT-Linux * OperatingSystem: Linux * Embedded Linux Developer * QT-Lunix experienced programmer * GUI environment * Ability to work at high pressure * Have experienced at least 2 years after graduated University



II. Benefit

* Basic Salary : USD1,000~1,300 * Round airticket, room and food support from company. * Have opportunity to work and study in profesional and dynamic environment. * Have chance to get used to high technology. * Work at Korea,south

III. Main Contact

For futher information, pls don't hesitate contact with us follow the way: * Vietclever Company * Email: jobs@vietclever.com * YM: vietclevervn * Tel: (84 4) 761 4621 * Mobile: 090 410 8989 (Mr.Ha) 095 330 0027 (Mr.Tan) * Website: http://www.vietclever.com *Add: Vietclever JSC No.3 A2 Co Khi Luyen Kim Living Quarter Ba Dinh, Ha Noi, Viet Nam.





You cannot post until you login.