Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a new user with root privileges from visudo in order to log on the Ubuntu system.

When I run Ubuntu a dialog box appears with the name of a user, let's call it "Sr. X". If I click on "Sr. X" the system ask me for the password, which I don't know.
So I'm trying to add a new user with root privileges by running an Ubuntu image from a USB device. After locating the unit in which Ubuntu is installed, I mount it and type chroot to turn the path of the Ubuntu image into the root directory.

So far so good, the problem comes when I try to add a new user by modifying sudoers file using visudo.
User "Sr. X" doesn't appear - why is that? The only thing that appears is

root ALL=(ALL) ALL

Then, I add my user:

Myuser ALL=(ALL) ALL

save the changes and reboot the system. When I run Ubuntu, the same dialog box appears, only showing "Sr. X" again. I click on "login as another user", I put "myuser" into the dialog box and the system ask me for a password. What password should I write? I didn't add any password in the sudoers file. Can somebody help me with this?

share|improve this question

migrated from Feb 8 '12 at 20:46

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

visudo doesn't add users. Try useradd, adduser, or (if you know what you are doing) vipw.

However, if all you are trying to do is log in, just reset Sr. X's password as root:

# passwd userX
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
share|improve this answer
ok, I'll try this, thanks! – cracq Feb 8 '12 at 21:06

You must log in to answer this question.

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