LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-21-2005, 09:35 AM   #1
RipClaw
LQ Newbie
 
Registered: Oct 2005
Distribution: PCQ Linux 2006
Posts: 19

Rep: Reputation: 0
How to create another root user ?


Hi,
I would like to know how to create another root user, with the same privilege of the "root" user.
I windows, it is as easy as moving the required user to the Administrators group.

In Linux, I heard that there are lot of steps!
I would like to know them

I created a user with group id = 0, but it doesn't work!
 
Old 10-21-2005, 09:53 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,913
Blog Entries: 14

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
You would give it UID 0 not GID 0. You also need to make sure the new user name appears lower in /etc/passwd than root itself.

However this is a really BAD IDEA!

You should always log in as a non-privileged user and then su to root when you need to do something root requires. Unlike Windows you don't have to logout and log back in to become the admin user - a simple "su" command will let you do root tasks.

If you have other users who need SOME root level access to some commands you should setup sudo rather than giving them full root access.

Have a look at this forum for a detailed scenario of why logging in as root all the time is a bad idea - I have a post there:

http://www.linuxquestions.org/questi...postid=1888152
 
Old 10-21-2005, 10:04 AM   #3
RipClaw
LQ Newbie
 
Registered: Oct 2005
Distribution: PCQ Linux 2006
Posts: 19

Original Poster
Rep: Reputation: 0
With the username "root" having already a UID of 0, is it possible to make another user, say "root2" with UID 0 ???
 
Old 10-21-2005, 10:27 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,913
Blog Entries: 14

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
Yes.

The files will still show as owned by root when you look at them but in actuality the passwd file is just a lookup table. The files are owned by "0". When it looks the file up it finds "root" as the first definition for "0" so uses that name.

Again I urge you NOT to do this though.
 
Old 10-21-2005, 03:48 PM   #5
jrdioko
Member
 
Registered: Oct 2002
Distribution: Debian 6.0.2 (squeeze)
Posts: 944

Rep: Reputation: 30
Instead of trying to figure out how to do that, why don't you tell us what you're really trying to accomplish and there may be a better way to do it. I'll just add another person's opinion: you should never give your normal user root privileges, it's far too easy to wipe out your entire system that way.
 
Old 10-21-2005, 03:51 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Look into using "sudo". There is a group called wheel that circumvents some of the restrictions placed on regular users.
 
Old 10-21-2005, 03:53 PM   #7
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
Short answer: Don't create another super user.

The answer is
Quote:
Look into using "sudo".
 
Old 10-21-2005, 06:57 PM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 8,326
Blog Entries: 4

Rep: Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842Reputation: 2842
As others have said, it's not a question of can you do it, but should you, and the latter answer is a resounding, cacaphonic, "Hell, No!"

Let me put it this way... above the dark doorway of That Which You Contemplate To Do are inscribed these words:
Quote:
Through me the way into the suffering city
Through me the way into the eternal pain
Through me the way through the Lost Plaugher
Justice moved my Kernighan
My maker was divine Ritchie
The highest wisdom, and the primal love for hacking.
Before me nothing worthwhile was created (Multics was no damn good)
That was not eternal, and I endure eternally.
Abandon all hope, you who enter!
 
Old 10-22-2005, 05:17 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,913
Blog Entries: 14

Rep: Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142Reputation: 1142
Talking

Or even:

There once was a noob with suid zero
In duping he thought to make himself a hero
By name called he was RipClaw
On doing it he felt the ripsaw
Because of an attack by a hacker named Nero
 
Old 10-22-2005, 05:39 PM   #10
hackerarchangel
Member
 
Registered: Jan 2005
Distribution: Suse 9.3
Posts: 119

Rep: Reputation: 15
STupid! Just use -sudo or if you are lazy, you can probably go into the user accounts thingy that allows you to graphically se what is up with the users, and just give that user permissions to certain areas of the os! BUT NOT ALL OF IT!! Naughty newbies.....
 
Old 10-23-2005, 07:06 PM   #11
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Quote:
Through me the way into the suffering city
Through me the way into the eternal pain
....
When I read Dune, I seem to remember that the Litany of Fear was a little bit different!

But if the mental image of "burning flesh" appears when a newbie thinks of creating a second root account, that might be a deterrent indeed!
 
Old 10-23-2005, 07:07 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Quote:
Through me the way into the suffering city
Through me the way into the eternal pain
....
When I read 'Dune', I seem to remember that the Litany of Fear was a little bit different!

But if the mental image of "burning flesh" appears when a newbie thinks of creating a second root account, that might be a deterrent indeed!
 
Old 10-24-2005, 06:36 AM   #13
RipClaw
LQ Newbie
 
Registered: Oct 2005
Distribution: PCQ Linux 2006
Posts: 19

Original Poster
Rep: Reputation: 0
Guys, I just don't understand, what is wrong in creating another root user!!. In windows too we have the "Run As" command, like "sudo" in Linux, but that doesnt mean I add co-admins in the Administrators group.

What if the user "root" 's password gets forgotten & the server is not in an easily reachable place ???
If some other co-admin has root provileges, then atleast he can reset the pass for me.
 
Old 10-24-2005, 07:17 AM   #14
blindcoder
ROCK Linux
 
Registered: Dec 2003
Location: Berlin, Germany
Distribution: Crystal ROCK
Posts: 108

Rep: Reputation: 15
Quote:
Originally posted by RipClaw
What if the user "root" 's password gets forgotten & the server is not in an easily reachable place ???
If some other co-admin has root provileges, then atleast he can reset the pass for me.
And that's exactly why sudo uses the users password as authentication instead of the root users password.
In effect, with sudo, you can allow any user to run any command as super user. Every user then has a different password.
So what you would probably want to do is allow user X and user Y to run command as root. Let's say ANY command for the sake of the argument.
You would then run the program visudo and enter the following lines:
Code:
X    ALL=(ALL) ALL
Y    ALL=(ALL) ALL
That way, calling any program as parameter to sudo would enable the user to run that command as superuser. Example:
Code:
blindcoder@ceres:~$ sudo bash

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

Password:
bash-2.05b# id
uid=0(root) gid=0(root) groups=0(root)
bash-2.05b#
At the "Password:" prompt the user would then enter HIS password. Not the super users password. This help against accidentally leaving a user shell open. And the user won't have to reenter the password for a few minutes for convenience's sake.


HTH,
Benjamin
 
Old 10-24-2005, 08:12 AM   #15
mjjzf
Member
 
Registered: Feb 2004
Location: Valby, Denmark / Citizen of the Web
Distribution: Slackware 14.1
Posts: 879

Rep: Reputation: 39
Besides using sudo, which is a good choice, this is a good time to get a grasp of group permissions. Root should generally be used as little as possible, but there is no reason not to grant users the right to perform administrative tasks. Try checking the man file for sudo; it has good examples for these scenarios, although it is a bit long.
Lastly: I dont want to seem like a cranky old man, but if you are likely to 'lose' the root password, you really shouldn't administer anything but a user account.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to create user root accounts - SuSE 92 jdaniel Linux - Software 3 07-29-2005 11:35 AM
how to create root-like user/account? rsumbeling Linux - General 6 11-23-2004 12:38 PM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
How can i create another user than root? BroinK Slackware - Installation 3 01-22-2004 01:20 PM
How can I create a user with the same privileges as the root ? Menestrel Linux - Newbie 3 11-19-2003 09:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration