Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am confused on the following in linux.
Can I have a user to have the same permissions as the root. In Windows any user can be the administrator but I am not clear exactly about this on Linux.
It seems that root is the "magic" account with all permissions, but can I create a user that has exactly the same permissions?
E.g. if I am user jim in Linux can jim be root? I am not talking about sudo but being able to do anything the root does.

share|improve this question
    
It's no problem to have different usernames with uid 0 in the system. Use useradd -o -u 0 rootz ... e.g.. I've used that to have a root login with a different shell. –  ott-- Jul 20 '13 at 21:19
    
@ott:Could upgrade jim to be root? –  Jim Jul 20 '13 at 21:20
    
The preferred way is sudo, so jim could execute specific or all commands as root. –  ott-- Jul 20 '13 at 21:23
2  
For the record, the Windows equivalent of the *nix root is actually SYSTEM. –  Bob Jul 20 '13 at 21:49
    
@Jim You need to add more info in your post, what version of Linux are you running? Redhat, Ubuntu, etc..... –  nate Jul 20 '13 at 22:53

3 Answers 3

Is possible but not recommended create an account with the same privileges as root, by several factors.

Check Man adduser.

share|improve this answer
2  
Why did you remove the example? Your post would be much better if it included not only a link to the manpage, but a practical example of how to achieve what the OP needs. –  slhck Jul 21 '13 at 10:35

The preferred way to run commands with administrative privileges is sudo for CLI and gksu for GUI. Read up on visudo for info on how to configure access for users through these commands. If you're the only user on your system and not concerned about someone else using it and messing something up, it's possible to be able to execute commands as root without password for sudo. You shouldn't run some applications as root, for example IRC. That's why there's sudo, and without it, commands are run as the current user by default to prevent unauthorized root access from application level.

share|improve this answer
    
it's possible to be able to execute commands as root without password for sudo How? –  Jim Jul 21 '13 at 7:53
    
Check the sudo documentation on how to add NOPASSWD to your sudo user. NOTE this is not recommended because it makes it that much easier to make a horrible mistake. –  Shadur Jul 21 '13 at 8:46

Yes and no, at least "no" means you won't have it behave like I think you expect.

In UNIX, there's UID 0, b.k.a root, and everyone else. This is coded in the kernel, it's not something you can easily change.

Yes, you could have jim also be UID 0, but then that mixes things up. Remember that you don't store user names really anyplace, you store userids, and reverse map it through /etc/passwd (or other maps like LDAP) when needed. So, when jim does ls -l in his dir, he'll probably see his files owned by root. jim isn't another account, as much as an alias for root. This aliasing doesn't seem to be what you want.

This aliasing can be useful. FreeBSD has root with shell /bin/sh (which sucks for interactive use, but is statically linked and doesn't use /usr) and toor, also UID 0, using /bin/tcsh. If the system went to hell, you used root, which depended on fewer things. But for routine maintenance, you'd use toor, which had an easier to use shell. But this is an alias, not two separate accounts, and not what you want.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.