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.

I was asked for root credentials to setup my printer in Ubuntu. This seemed to be caused by a bug. And the suggested workaround is to create a root password. Since it is default that no root password is used in Ubuntu, i wonder how i could revert this changes.

Once i have set a password for root, is there a method to disable it again?

share|improve this question
add comment

3 Answers

up vote 15 down vote accepted

According to Ubuntu online help

Ubuntu developers made a conscientious decision to disable the administrative root account by default in all Ubuntu installations. This does not mean that the root account has been deleted or that it may not be accessed. It merely has been given a password which matches no possible encrypted value, therefore may not log in directly by itself.

If you want to enable root account simply give it some password using

sudo passwd

When you enter this command you will be asked for new password. The password you enter will be the password for root account so be careful and choose a strong password.

To disable the root login use

sudo passwd -l root

This will disable the login using root user name i.e your system will be back to previous state.

If you want more information on user management in Ubuntu read https://help.ubuntu.com/8.04/serverguide/C/user-management.html

share|improve this answer
add comment
sudo usermod -p '!' root

That will set the root account to have an unusable password.

You can also lock the account to stop people logging in.

sudo passwd -l root

Either approach should do what you want. You don't need to do both.

share|improve this answer
    
I don't get it. Why an unusable password? –  Tshepang Jan 7 '11 at 12:54
    
Unusable in that you cannot log in with it. It's what the password starts off as AFAIK. –  Oli Jan 7 '11 at 12:56
    
when i disable it with: sudo passwd -l root. do i have to remember the current root password for future use, perhaps if i someday want to activate root password again? –  NES Jan 7 '11 at 13:16
1  
@NES no you dont have to remember it. you reset the password and time with "sudo passwd" –  binW Jan 7 '11 at 14:01
add comment

It's not true that there is no default root password. Instead, root has a blank password.

If you define another password, you don't have to use it.

share|improve this answer
6  
If there is a password it means people could log in if they knew the password. Resetting the password back to nothing or locking the root account is better for security. –  Oli Jan 7 '11 at 12:54
    
So the password you assign shouldn't be one which could be guessed. Perhaps I'm thinking of the owner of the system as the only user. Surely, the owner of the system should know the root password, if there is one. Hmm! 4 downvotes .. you people are even more harsh than the ones on Slashdot. –  pavium Jan 7 '11 at 13:16
3  
Never mind, anybody can be wrong. You can delete your answer, if you want. You'll even get a badge for it. :-) –  Stefano Palazzo Jan 7 '11 at 13:48
    
I don't think I am wrong. I just have a different opinion. And I didn't mean Slashdot, I meant Stackoverflow, where there are similar penalties for disagreeing with Jon Skeet. –  pavium Jan 7 '11 at 20:18
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.