home   |   about us   |   our network   |   services   |   affiliates   |   contact
 
Services
» Web Hosting
» Reseller Hosting
» Dedicated Servers
» Windows/ASP.net Hosting
» Managed Web Hosting
» Server Security / Auditing
» Remote Backup / Storage
» Virtual Dedicated Servers
 
Support
» Support Desk
» Client Login
» Forums
» FAQs
» Help Files
» Acceptable Use Policy
» Client Testimonials
» Blog
 
Tutorials
» Dedicated Server Tutorial
» Website Optimization
» Search Engine Optimization
» Web Hosting Tutorials
» Web Programming Tutorials
» Networking Tutorials
» Virtual Server Tutorials
» Resources



The Crucial Blog - Archive

February 17, 2008

Resetting lost root password in Debian server

In getting into just the single user mode may not allow you to reset the root password. It might prompt you with the following question ;)

‘Give root password for maintenance (or Control-D to continue)’ .

Don’t worry, reboot the server.

(1) At grub boot screen, select the kernel and press ‘e’ to edit the entry.

(2) Another list will show up. Scroll down and pick from the list something that looks like this (or something similar):

kernel /vmlinuz-x.x.x-x.x ro root=/dev/abc/

(3) Type ‘e’ again to edit this line. Make sure that you press the space bar and add the following:

init=/bin/bash

(4) Then press enter. The line should look something like this then:

kernel /vmlinuz-x.x.x-x.x ro root=/dev/abc/ init=/bin/bash

(5) Press ‘b’ to boot. This will take you into a bash terminal. From there you’ll have to mount your hard drive and allow for read/write permissions.

(6) mount -o remount,rw /

You need to do this because / is currently mounted read-only and many disk partitions might have not been mounted yet.

Or

If you have to see the mount details. Type the command

mount

It should come up with something like, for /:

/dev/abc (rw)

It looks like it’s already set for read/write permissions, but it’s not (just try and reset the password with the passwd command and see what happens). To mount it again type the following command:

mount -o remount,rw /dev/abc /

(7) Now you should be able to change the root password by issuing the following command:

passwd

(8) After the password has been reset, type ‘reboot’ and reboot the server.

The job is done ;-)

Note:

For LILO:

(1) As the server reboots, you might have to hold in the “shift” key to see the lilo: prompt (depending on the setup)

(2) At the lilo boot screen, as soon as ‘boot:’ appears enter:

boot: init=/bin/bash

This causes the system to boot the kernel and run /bin/bash instead of its standard init.

Follow the same procedure of remounting slash as with GRUB.

Tags: , ,

Related posts


No Comments

Filed under: Uncategorized by — aaron @ 2:39 pm




     

Quick Links: Debian Dedicated Servers, Direct Deposit Hosting, Unmetered Dedicated Servers, Virtual Dedicated Servers, Windows Server Management, High Traffic Web Hosting - Load Balanced Clusters, Windows 2008 Server Virtual Dedicated Servers