Solved

Reset root password - How-to?

Posted on 2003-11-20
7
66,030 Views
Last Modified: 2013-12-16
I have installed RedHat Linux 9.0, but I forgot the root password, how can I access my pc, I heard that we can reset the root password wil disc 1 of Redhat Linux 9.0 but I don't know how. Please show the way!
Thanks
0
Comment
Question by:tinh911
7 Comments
 
LVL 38

Expert Comment

by:yuzh
Comment Utility
If you are using lilo to boot, then at the LILO
prompt, you can go into the single user mode.  If your normal boot image
 is called linux, then enter "linux single" or "linux init=/bin/bash" at
 the LILO prompt.  The run passwd and set a new root password.  After
 this, you will want to change to the normal run level, or reboot.

0
 
LVL 38

Accepted Solution

by:
yuzh earned 125 total points
Comment Utility
or boot the system up from FD or CD, mount the /root partition. edit the /etc/shadow file
get rid of the password. reboot and reset the password.

Have a look at the following page for more detail instructions:

http://linux.about.com/library/bl/open/newbie/blnewbie3.2.3.htm
0
 
LVL 12

Expert Comment

by:paullamhkg
Comment Utility
Some of the below info similar to yuzh suggested, just want to give you more choice to recover your password.

#
# Original Version
# ----------------
#       http://www.Linux-Consulting.com/Boot/Boot.SingleUser.ForgotRootPasswd.txt
#
#
# ================
# Booting problems
# ================
#
#
#
# how to fsck /dev/hda1 which is root when its mounted rw
# and fsck warns it is dangerous to e2fsck it
#
init 1
mount / -o remount,ro
e2fsck /dev/hda1
mount / -o remount,rw
init 3
#
#
# Changing root passwd
# ----------------------
#
Boot from a root-boot standalone floppy-based linux
      mount /dev/hda1 /mnt
      vi /mnt/etc/shadow
#
#
#
# Booting into bash
# =================
#
lilo_prompt: linux init=/bin/bash
#
      - mount -n -o remount,rw /
      - vi /etc/shadow
#
#
# Single user Mode
# ================
lilo_prompt: linux 1
      - vi /etc/shadow
#
#
#
# With Root/Boot Floppies
# =======================
#
#      http://www.toms.net/rb
#
Tom's RootBoot
      - boot it
      - mount /dev/hda1 /mnt
      - vi /mnt/etc/shadow
      ...
      - sync
      - umount /mnt
      - Reboot
#
#
# With Redhat Install CD
# =======================
#
#      - boot it
      - go into rescue mode
      - mount  /dev/hda1 /mnt
      ...
#
#
# With Debian Boot CD or Boot Floppies
# ------------------------------------
#
#      - boot it
      - go into rescue mode
      - mount /dev/hda1 /mnt
      ...
#
#
# end of file

0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 1

Expert Comment

by:Sachin_Yash
Comment Utility
Hi Buddy !!!

                            I think I have rather better solution for you....
                           Just relax & forget about the cd's & floppies...
                           For resetting the password follow these steps :-

                          1. Reboot your PC & when u see the loader screen just type 'e',
                               U will see another boot screen like :-

                              kernel boot....  /    ...  /LABEL=/
                               press 'e' again ...
                           
                          2. Modify this line as :-  (just type '1' after giving single space after  "/LABEL=/" )
                                 i.e.
                                            kernel boot.....     /LABEL=/  1
                                Press Enter....
                          3. When u see again the second scren  type 'b'.
                     
                          4. you will automatically go to the superuser prompt .... like
                                      sh-0.15 #
                               just give command as :-
                                      sh-0.15 # passwd root
                              linux will ask you for new password give it & reboot your machine....
                         5. Next time login as a root... & as a root u can easily set or reset the password of all other user..

                           Try it........
0
 

Author Comment

by:tinh911
Comment Utility
Yeah, it's such a strange way! No CD and floppy!
I'll try it!
0
 

Expert Comment

by:roks1957
Comment Utility
Dear Sir

My RedHat Linux 9.0 Server is booting properly, The login Page also appears. But When I enter User and Passwd nothing happens but the login prompt appears (No Errors Whatsoever). Same goes when I attempt to login in text mode i.e Terminal window (Ctrl+Alt+F1 or F2 ...etc).

I was trying to configure FTP on my Linux Server and made some changes to /etc/ftpusers, /etc/hosts.allow etc.
But next day when rebooted the machine I am not able to login either as root or normal user and No Error Message Appears whatsoever.

I have tried booting thru Installation CD-1 , linux rescue, Shell prompt, Undid all changes made in a/m files like /etc/ftpusers , removed passwd from /etc/shadow. Even changed Passwd of root at root prompt Using #passwd root . Rebooted the System without CD-1 now but same problem persists.

Request Guide to get rid of this Problem Please

Thanks
Rakesh
rakesh@irfc-nausena.org
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now