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 unexpectedly deleted my user account (the only administrator for the machine). I have another account which is standard account now i cant access my hard disk or anything with that standard account it is asking for boot password. Is there any way i can get back access to the administrator account?

share|improve this question
    
Related: How do I add myself back as a sudo user? I'm not sure if we should consider this a duplicate. Probably not, since this has answers about how to create a new account (and that's about how to make an existing account an administrator account). –  Eliah Kagan Jul 31 '13 at 21:03
add comment

2 Answers 2

You can use the recovery console and boot as root this is a extra option on your grub menu and create a new user then add them to the admin group. I'm not sure if this will fix your issue, but give it a try and let me know.

useradd newuser
adduser newuser admin
share|improve this answer
add comment

You can use recovery mode to add the standard user to the admin group (which is now called sudo in 12.04). Below is a set of simple instructions copied from my personal website.

Using Recovery Mode To Add Users To The Admin / Sudo Group

First shutdown your computer.

Then restart whilst holding shift on the keyboard to load grub menu.

Select recovery mode from the grub menu.

Select drop to root shell from the recovery menu.

Use the following command to remount the drive mount -o rw,remount /

Now type adduser username sudo replacing username with your user name ie. 'adduser phil sudo'

You should now see a message saying 'adding user' followed by 'done'.

Type shutdown -r now to restart the computer.

EDIT: If it is telling you that user xxx does not exist, first you can use the following command to list users and make sure that you have the correct username

ls /home

The other option is add a new user, from recovery mode using the following commands :

useradd username -m -s /bin/bash  
passwd username
adduser username sudo

Again replacing username with your desired username.

share|improve this answer
    
whilie in adduser comand it is showing user XXX does'nt exist please help me. –  Niranjan Jul 8 '12 at 13:05
    
@Niranjan - I have edited the answer to include the information you need. :o) –  Fernhill Linux Project Jul 8 '12 at 13: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.