Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When I first installed Ubuntu 13.04 from a USB stick I was asked to fill in for user username and password so I set one on my own. When I run Ubuntu I click log in but it automatically logs me in as user so I can't type my username. As a result, in order to run certain apps or set up my network I'm asked to type the root password for authentication. I don't wanna log in as a superuser. Please note that I'm a newbie to Ubuntu. Thank you in advance.

share|improve this question
    
Read here please:RootSudo - Ubuntu Wiki –  NikTh Jun 9 '13 at 10:32
    
What is your question? –  Alvar Jun 9 '13 at 10:39
    
Well I did that and it says operation not permitted. What do I do now? :'( –  Ele Jun 9 '13 at 11:01
    
Automatically logs you in as what user? Guest? Are you asked for a root password or an administrator password? –  Seth Jun 9 '13 at 22:57
    
@Seth Guest yeah. I'm asked for a root password. Without it I can't access anything and take advantageof Ubuntu :/ –  Ele Jun 10 '13 at 8:32
show 2 more comments

4 Answers

up vote 1 down vote accepted

Okay, there is a difference between your password and the root password (the password of the account "root").

When you first installed Ubuntu, you specified your username (let's say you chose Ele) and your password; this is the password that you would use to log in. Since you have Ubuntu to log in automatically, you won't be asked for this password when booting Ubuntu.

The default installation of Ubuntu makes your user an admin; that is, it makes you able to install and remove applications and all that. The password that is asked when you install/remove components is usually your password, Ele's password. Take a look at these screenshots:

enter image description here

  • This program is asking you to Enter your password, so this would be the password of Ele, that you used to install Ubuntu, which is the same password you use to log in.
  • If you did not set a password when you were installing Ubuntu (and I think this is where your problem is Ele), then you need to set a password for your user. To do so, simply type the following command (commands can be typed in a terminal which you can open by Ctrl+Alt+T):

    passwd
    

    And enter your new password. Note: you won't see any stars *** or anything; don't worry, just continue typing.

Now, let's look at another kind of prompt that could ask you for a password:

enter image description here

  • This program is asking you to Enter the administrative password, which is the root password, the superuser password, the password of the account "root". This password is NOT set by default.
  • It is generally not advisable to set a root password unless you really need to, because it essentially opens doors to lots of accidental, harmful tasks. But, if you really want to set the root password, you would do this:

    sudo passwd root
    

    It will first ask you to enter your password, in order to carry out this command (because you typed sudo). Then, it will ask you to specify a new root password.

    • If your account does not have a password set in the first place, this command will not work, because you are performing a sudo command, which will require your password first.
  • Note1: if you have set a root password and you want to remove it and go back to how it was, do this command:

    sudo passwd -dl root
    

    It will, again, ask you for your password, because you are doing a command that starts with sudo. This command deletes the password and locks the root account.

  • Note2: you should rarely see this second screenshot, the one that's asking for the root password. Usually, you'll be asked to enter your user's password. That is how Ubuntu is set up, so that you don't need to log in as the root (superuser) to perform administrative tasks, you only "borrow" the root privileges by using the command sudo.
share|improve this answer
    
That's the way :) –  SimplySimon Jun 11 '13 at 15:47
    
@Alaa Thanks a lot. That was really helpful :) –  Ele Jun 30 '13 at 16:33
add comment

Use

sudo passwd

Essentially, it makes root do 'passwd' which sets a password for the user who used the command.

share|improve this answer
    
If you are setting your own password, there is no need to do sudo. Any user can set their own password by issuing the command passwd alone. –  Alaa Jun 11 '13 at 15:57
add comment

Type the following in the command line:

sudo su

Then generate new password for root:

passwd

share|improve this answer
    
ouch ! - a teacher with red stick ? ;-) –  dschinn1001 Jun 9 '13 at 11:34
add comment

How to change your root password

For both of the following, press Ctrl + Alt + T to launch a Terminal window then:

Method 1

Type in

sudo  passwd

Method 2

Type in

sudo su

Then to create a new password for su enter:

passwd.

Conclusion

Essentially, these commands asks root to do the passwd command. This sets the root password which is the one you type to access root privileges with su.

su offers the following: In terminal and programmes run from terminal, you have changed from being you@your_computer to root@your_computer.

Edit

Just looked at the other answers and this appears to be an amalgamation of the two previous ones! My apologies.

share|improve this answer
1  
No, sudo passwd will change the password of the user that executed that command, not the root password. If you want to set the root password, you would do sudo passwd root. –  Alaa Jun 11 '13 at 15:02
    
Thanks for that. I know I changed mine, but I couldn't remember how. :) –  SimplySimon Jun 11 '13 at 15:41
    
The root password? You probably did sudo passwd root; take a look at my answer. –  Alaa Jun 11 '13 at 15:44
add comment

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.