Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-01-2014, 10:48 AM   #16
Registered: Oct 2013
Location: IN, USA
Distribution: Arch, Debian Jessie
Posts: 813

Rep: Reputation: 264Reputation: 264Reputation: 264

If you lost both passwords, you will need some live media. Boot into the live media, then get to a terminal and become root (try 'sudo su'). Mount the fielsystems to /mnt. chroot into /mnt. Run 'passwd root' to change the root password. While you're at it, you might as well change your normal-user password as well.

Disclaimer: I've only done this on Arch systems, but it should(tm) work on Ubuntu.
Old 06-01-2014, 06:02 PM   #17
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 3,383
Blog Entries: 1

Rep: Reputation: 717Reputation: 717Reputation: 717Reputation: 717Reputation: 717Reputation: 717Reputation: 717
Originally Posted by maples View Post
Disclaimer: I've only done this on Arch systems, but it should(tm) work on Ubuntu.
For an ubuntu install you have to:

# passwd -d root

and then

# passwd root

But I've only tested that on linux-lite via the chroot mentioned. You should NOT do that as that's not how ubuntu is supposed to work. You can su to root after doing that. And I don't know of any way to UNDO that. If the user is in the adm and sudo groups it has root permissions by using sudo. And you can change the users password with passwd in the chroot without doing that. The user(s) should be discoverable by checking out the contents of /home/ and /etc/group.
Old 06-02-2014, 12:52 AM   #18
Registered: Jun 2006
Posts: 66

Rep: Reputation: 21
No need to chroot or any other messing around with single user mode.
Boot from a live cd.
Find the hard drive partition that contains the ubuntu filesystem and just mount it if the liveCD has not done it automatically.
Go to where is mounted and cd into etc.
open the file sudoers in that etc directory.
Find who's member of sudo and adm. Close it.
Open shadow file in that etc directory
Find the user that has administrative privileges (you found it in sudoer file)
Remove anything from the first : after the name to the next : (make it empty). It will start with $6 and it is a long string.
Save the file and reboot
That user has an empty password now. Login, just pressing enter, and create another password.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset Root password hbenway AIX 9 08-19-2008 05:13 PM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 05:11 AM
How to reset root password in Ubuntu? concoran Linux - Newbie 7 12-13-2007 04:04 PM
reset root password kapslock Debian 14 07-27-2006 08:08 AM
Reset Root password sdsouza Linux - Software 5 11-12-2003 05:50 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration