Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Lost Root Password.
Now What?

Oracle Tips by Burleson Consulting
January 6, 2004
Don Burleson

Special Thanks To Adam Haeder for this tip.


There are a number of different ways to do root password recovery on a Linux system. Different distributions make it easier than others. RedHat makes it very easy.

You must be physically in front of the system. Reboot the computer (usually ctrl-alt-delete will do it safely) and after POST, the system will come to a boot loader screen. Newer versions of RedHat (including the AS versions) use grub as the boot loader, so you should see a graphical menu in which to select what kernel you want to boot.

Select the kernel to boot and then hit 'e'. This will take you into a mini-editor where you can change the line that's used to boot the system. What we want to do is to pass an additional argument to the kernel, telling it what runlevel we want to boot into. This will override the default runlevel setting in /etc/inittab.

So after hitting 'e', we cursor down to the line that starts with 'kernel' and cursor all the way to the end of the line. Put a space after any existing kernel arguments and type the number '1' (without the single quotes). Hit enter here to accept the change and you're back at the grub boot screen. Then hit 'b' to boot to this line. The system will boot into
runlevel 1 (single user mode) and you will be dropped to a root prompt without being prompted for the password. From here you can type 'passwd' to change the root password. When you're done, type 'exit' and the system
will boot to the default runlevel.

This works on all distributions; however some distros by default will require that you know the root password before letting you boot into runlevel 1 (Mandrake and SuSe come to mind). You can also password-protect grub itself so you have to know a special password in order to change the boot options.

On distros like this, the easiest way to change the root pw is to boot off of a linux bootable cd-rom. There are many freely available 'rescue'-type distros out there, some even small enough to fit on a floppy. My personal favorite is Tom's Boot/Root disk (http://www.toms.net/rb/). The steps to do password recovery with a boot/root disk are:

- Boot to the boot/root disk
- Mount your existing root partition under a temp directory
- edit the /etc/shadow file on your root partition
- Remove the encrypted password from root's entry in the shadow file (the
second field in this colon delimited file)
- Reboot and boot to your normal partition. Root's password is now blank.

On a system with the root partition on /dev/sda1 (The first partition on the first scsi disk drive) it would look like this:

Boot to Tom's Boot/Root disk
Log in as root

# mkdir /tmp/harddisk
# mount /dev/sda1 /tmp/harddisk
# vi /tmp/harddisk/etc/shadow
< Remove root's encrypted password and save >
# cd /
# umount /tmp/harddisk
# shutdown -r now



 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational