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.

Well, this is a simple answered question, from the title, but my real problem is hard af.

I have set ubuntu to use root, then it wouldn't let me log into the admin account only root and guest

I deleted the admin account, remade another, then attempted to disable root account.

This failed - I messed up the password, the original password was "root"

I also didn't set a password for my new admin account, so It says it has one, whats the default password for it?

I can't moderate my ubuntu system at all now. I have tried to drop to cmd shell thing, it asks for the root password, i type 'root' and any other possible passwords, it doesn't work.

To reset ubuntu to factory settings i have found that i could enter the following code:

sudo dpkg-reconfigure -phigh -a

sudo Requires admin password, that I cant find out without root password and I don;t know.

My goal is to try to fix this without remaking a bootable usb for ubuntu, because I lost the one i made for this. so If i can't, please say so. If you can help thanks!

share|improve this question
add comment

2 Answers 2

Well, If you totally lost root access Ubuntu is not going to allow you, from inside, to get root access. That would be a security issue.

Second, you shouldn't add a root user without a good reason. I recommend you to think why you need a root user.

The recommended way of dealing with that is by using the sudo system. The sudo system allows an user to promote an application or command-line (cdm as you call) program to act as root or other users without having to log in as this user. This adds an extra security layer in many senses.

In ubuntu the first user has the right to act as root. This means that when you use sudo you are going to execute the command given as root. If you are logged in as the first user created and you execute:

sudo dpkg-reconfigure -phigh -a

You are asked for YOUR user password. If you did not mess with that configuration you should be able to execute this command.

But this command will almost for sure not fix your problem. You will need to fix any problem that you made with the users manually by the command line.

It would be probably easier (if your installation is not really old or customized) to reinstall. But that's just a suggestion.

Please, tell us in the comments if you succeed.

share|improve this answer
1  
Thanks, I re-installed because I found my USB that had Ubuntu on it, Everythings fine now, ;) –  Cameron Oct 20 '12 at 22:10
add comment
  1. Your are using the console, aren't you? so the passwd command allows you to set a new password for your user.

  2. If you reboot you can try to catch the right moment, when the grub console should pop up. Press E to edit the command line which says kernel ... at the end add init=/bin/bash This will boot directly into a bash environment.

There you need to remount / with write permission (mount -o remount rw /, I guess). Having done this, you can set a new password.

reboot and enjoy

share|improve this answer
    
Yes, you can use the passwd command, but you need your current password to change your password. –  RPi Awesomeness Apr 4 at 13:40
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.