Operating System - Linux
1751936 Members
4701 Online
108783 Solutions
New Discussion юеВ

Re: user creation in RHEL

 
smkhairnar
Occasional Contributor

user creation in RHEL

i want to create user account & iwould like to give acess this user as root user in RHEL5...

Pls help
9 REPLIES 9
Michal Kapalka (mikap)
Honored Contributor

Re: user creation in RHEL

hi,

create the user as root

useradd -d /home/user user

then as root run:
visudo or vi /etc/sudoers

in the file you will see
root ALL=(ALL) ALL

add a line below that line that has
user ALL=(ALL) ALL

* replace "user" with the username you want.

then when you want to do some admin level work you would just use sudo before the command.

another solution is if you know the root pass, you could use su - or su -c "command for execute "

mikap
Kapil Jha
Honored Contributor

Re: user creation in RHEL

you want to give permission for some time or forever.....
in second case as described install/configure sudo or install some 3rd party software like powerbroker.

If for smtime and you can put its user id as 0 in etc/passwd, and it would do everything a root can do.
lil scary though ;)

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Ricky_HK
Frequent Advisor

Re: user creation in RHEL

You can use this command to create a new user which same as root...
useradd -o -u 0 -g 0 newname
Tim Nelson
Honored Contributor

Re: user creation in RHEL

If going the UID of zero route you might as well just give them the password for root as there would be no difference and no auditing.

the passwd file acts as a lookup table.. any entries or files for "joe" with uid of zero will show up as root.

This only confuses things more. have one root and only one ... "one ring to control them all"

sudo is the way to go if you are looking for autditing and accountability

Vipulinux
Respected Contributor

Re: user creation in RHEL

Hi

best way is to give it thru sudo; dont make the id as 0.

Cheers
Vipul
Kranti Mahmud
Honored Contributor

Re: user creation in RHEL

Hi smkhairnar,

Creating another root user can be a security risk. Root has a UID of zero in /etc/passwd. This means absolute control over the system for the root user. You can set any user id to 0 (zero) to grant unlimited permissions provided that you login as root.

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
bullz
Super Advisor

Re: user creation in RHEL

cp -p /etc/passwd /etc/passwd.todaydate
vi /etc/passwd

"replace the user's u ID by 0"

Example
*Here xyz is the username

xyz:!:1234:71022::/home/xyz:/usr/bin/ksh
xyz:!:0:71022::/home/xyz:/usr/bin/ksh

Jared Middleton
Frequent Advisor

Re: user creation in RHEL

bullz,
That comcept is exactly what we're trying to advise smkhairnar NOT do.

Multiple UID 0 accounts are a terrible security and stability risk. At the very least, it provides hackers with extra opportunities to guess a root-level password.

It would be a lesser evil for multiple SysAdmins to share a single common root password than to have multiple root-level (UID 0) accounts.

Also, some programs lookup a login name using the UID. Non-unique UIDs will likely confuse those programs, e.g. may return first/random/incorrect username.
Arockiasamy
Advisor

Re: user creation in RHEL

simple




useradd -o -u 0 -d /home/samy/ samy