[Techtalk] Unknown root password

James Sutherland jas88cam at gmail.com
Wed Aug 27 21:32:53 UTC 2008


On 27 Aug 2008, at 17:01, David Sumbler wrote:

> If I boot Knoppix and log in as root, then presumably I can view all  
> the
> files on the hard drive.  But how can I reset root's password for the
> installed system?


All you need to do is edit the file /etc/passwd on the machine's root  
filesystem. You should find an entry like this for root:

root:*:0:0:System administrator:/root:/bin/sh

That * tells the system to go and use the encrypted password from /etc/ 
shadow. Just delete that bit, so there is nothing between the first  
and second colons, and root has no password. Boot into the Ubuntu  
system, log in as root (which now has a blank password) and set a new  
one.

(You can usually do this without Knoppix, just by booting with init=/ 
bin/sh on the boot command line: this gives you a root shell with  
nothing else running, allowing you to make changes like this easily.  
Sometimes this is disabled, though, particularly in setups like  
university IT labs.)


James.


More information about the Techtalk mailing list