LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to create second super user like root? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-create-second-super-user-like-root-501135/)

enggsultan 11-13-2006 06:52 AM

How to create second super user like root?
 
Hi,

Can anyone tell me the way for creating another superuser in linux???

Thanks in advance

sultan

odcheck 11-13-2006 07:03 AM

If your using a red hat based system check if you've got a sudeors file.
Than you can give him all rights you want
Don't forget to use visudo to edit this file.

enggsultan 11-13-2006 08:08 AM

Quote:

Originally Posted by odcheck
If your using a red hat based system check if you've got a sudeors file.
Than you can give him all rights you want
Don't forget to use visudo to edit this file.

Acually I am using trixbox which is enclosed with centos-4 linux

And I thing this pakage is not included there??

then what would be the solution.. I mean .. Is this be done manually??

sultan

pixellany 11-13-2006 08:52 AM

Here are various commands that add users, groups, or add users to groups:
Code:

adduser,
deluser
msetuser
musertweaks
newusers
useradd
userdel
usermod
addgroup
delgroup
groupadd
groupdel
groupmod

Also:
Code:

groups <username>    (to see what groups a user belongs to)
more /etc/group    (to see all the groups and the users in each)

Use "man <command>" to get all the details on each one.

BUT: Danger, Danger---There should only be one owner/Sysadmin on a system. Otherwise, who is the one person that always knows the configuration?

enggsultan 11-14-2006 02:12 AM

actually, I know how create user.. But I want to made second sysadmin... after creating user, how can I give all administrative power??

sultan

reddazz 11-14-2006 03:10 AM

Quote:

Originally Posted by enggsultan
actually, I know how create user.. But I want to made second sysadmin... after creating user, how can I give all administrative power??

sultan

Use "sudo" as suggested above.

enggsultan 11-14-2006 03:32 AM

Quote:

Originally Posted by reddazz
Use "sudo" as suggested above.

actually I edited sudeors by visudo...

but still no updates...actually i want another sysadmin where he will have his own password and username like root and and his
password...

it would be better if show show some exmaples

thanks
sultan

phil.d.g 11-14-2006 04:01 AM

You can't make a second root account as such, but you can make another account which is sort of an alias of the root account. FreeBSD does this by default to provide a root user with a c shell and a root user with a bash shell.

Look up how /etc/passwd is set out and add a new user in there with a UID of 0.

However, for most purposes it is much better to use sudo because of additional benefits such as restricting users to just some administrative tasks and logging.

reddazz 11-14-2006 04:28 AM

Quote:

Originally Posted by phil.d.g
You can't make a second root account as such, but you can make another account which is sort of an alias of the root account. FreeBSD does this by default to provide a root user with a c shell and a root user with a bash shell.

Look up how /etc/passwd is set out and add a new user in there with a UID of 0.

However, for most purposes it is much better to use sudo because of additional benefits such as restricting users to just some administrative tasks and logging.

The toor account in FreeBSD is more of a rescue kind of account e.g. if you lose your root password or mess up your root account and need to gain access without resorting to single user mode. Its not an account for daily use. Obviously having two accounts that share the same uid and gid could be looking for trouble so I agree with you that sudo is the best way to go.

phil.d.g 11-14-2006 05:49 AM

Off topic, so I'll keep it brief. The toor account is not "more of a rescue kind of account". It is intended to be used when the system admin wishes to use an alternate shell - http://www.freebsd.org/doc/en_US.ISO...l#TOOR-ACCOUNT

reddazz 11-14-2006 05:53 AM

Quote:

Originally Posted by phil.d.g
Off topic, so I'll keep it brief. The toor account is not "more of a rescue kind of account". It is intended to be used when the system admin wishes to use an alternate shell - http://www.freebsd.org/doc/en_US.ISO...l#TOOR-ACCOUNT

First time I have seen that doc. My reference was http://www.freebsddiary.org/toor.php which is much older than the official FreeBSD docs. Cheers.

bokopperud 11-14-2006 06:13 AM

Quote:

Originally Posted by phil.d.g
You can't make a second root account as such, but you can make another account which is sort of an alias of the root account. FreeBSD does this by default to provide a root user with a c shell and a root user with a bash shell.

Look up how /etc/passwd is set out and add a new user in there with a UID of 0.

Sorry a bit OT...

Apart from it being a stupid thing to do security-wise, would it be possible to give the "other" root-user a different home-directory? Of course the two root users could look and make havoc in eachother folders (as both would be owned by root)...

-Koppe

bokopperud 11-14-2006 06:24 AM

Quote:

Originally Posted by enggsultan
Can anyone tell me the way for creating another superuser in linux???

I agree that using 'sudo' is the obvious choice, but out of curiosity; would it be possible to create a "near root" user, by adding him to certain groups? I was thinking first and foremost of the root-group, but maybe also (additionally) groups like adm, sys, rpm. I know the root-group isn't like the Administrator-group in Windows (*yuck*), but could it possibly be used in a somewhat similar way?

-Koppe

phil.d.g 11-14-2006 07:05 AM

Quote:

Originally Posted by bokopperud
Sorry a bit OT...

Apart from it being a stupid thing to do security-wise, would it be possible to give the "other" root-user a different home-directory? Of course the two root users could look and make havoc in eachother folders (as both would be owned by root)...

-Koppe

Not something I have tried, nor particularly feel the need to. It might work, though would probably confuse some programs.


Quote:

Originally Posted by bokopperud
I agree that using 'sudo' is the obvious choice, but out of curiosity; would it be possible to create a "near root" user, by adding him to certain groups? I was thinking first and foremost of the root-group, but maybe also (additionally) groups like adm, sys, rpm. I know the root-group isn't like the Administrator-group in Windows (*yuck*), but could it possibly be used in a somewhat similar way?

No, this is something I would strongly reccommend against doing. You would need to alter the permissions of the system binaries concerned and probably make use of ACLs, a horrible hack when compared to using sudo. Furthermore after applying updates to the system all your "settings" will be lost.

And reddazz, not a problem!

As a final note, whilst we are discussing these different methods please use the most sensible option there, in the majority of cases that means using sudo. In the case were you have two system admins for a system, if both admins are to be trusted with a root account then there should be no problem using the same root account and both knowing the password.


All times are GMT -5. The time now is 06:58 AM.