9

I've created a new user by using "User Accounts" in "System Settings". How do I grant rights so that this new user can have the same level of access as root?

2
  • You tell the new user the root password?
    – 41754
    Nov 4, 2013 at 10:07
  • 4
    Why do you want to do this? It's usually not a good idea to just give another user the same access as root, which is why others here are suggesting the use of sudo. If you can tell us more about what exactly you need this user to do, we may be able to figure out something even better for your situation. Nov 4, 2013 at 13:26

4 Answers 4

8

You don't want to do that. Use sudo, instead.

On recent versions of Ubuntu, the default group that is allowed to elevate using sudo is (appropriately) named "sudo". You can add the user by using usermod (or your graphical interface, which sadly I don't know anything about, or I would try to give you instructions for that).

usermod -a -G sudo new_user

Have the new user log in again. They should be able to sudo to other users after that.

2
  • 7
    "You don't want to do that.", looks like he actually wanted it.
    – PMint
    Nov 4, 2013 at 22:32
  • 1
    @PMint What people want and what is actually advisable are not always the same thing (although you answer actually suggests almost exactly the same method, so I'm not sure what you're getting at).
    – Chris Down
    Nov 5, 2013 at 3:00
8

root - there can be only one.

(but root can have multiple names).

To create an account with the same priviledges as root, just make the UID of the account equal to zero. Then they will be root, but with a different name.

Common examples of this are account names like toor which are created (e.g. on some *bsd systems) with UID 0, as an alternative root login - perhaps with /bin/csh rather than /bin/sh as the shell or some other frivolous reason.

However, as several people have already said, you do not want to do this. You may think you do, but you really don't. Install and configure sudo instead.

2
  • Interesting -- when I did that once, I could not login as the original root any longer, apparently because early on in the login process only user IDs (which are both 0) are used to look up information, and the new user was found first. Aug 25, 2016 at 11:00
  • @PeterA.Schneider Not just early on in the login process. User IDs define an account. If there are two entries with the same user ID but different user names, they're the same account, with two sets of credentials. Aug 15, 2017 at 21:20
2

You'd want to use the terminal. To give full root access, get to the root account:

su

After that, open the sudoers file:

visudo

Then, add your username to the list:

username ALL=(ALL) ALL

After that, you should've given the user full root access.

0

Use adduser USERNAME sudo as root, that's safer and also functional:

To add user "USERNAME" to the sudo group:

$ su root
# adduser USERNAME sudo
2
  • As far as I can tell, the question isn't about adding the new user, but about giving them access to the superuser account.
    – Chris Down
    Nov 4, 2013 at 10:10
  • usermod: group 'sudo' does not exist
    – user45645
    Jun 20, 2015 at 11:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .