Solved

Reset root password - How-to?

Posted on 2003-11-20
7
66,038 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
ID: 9792223
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
ID: 9792268
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
ID: 9794836
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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 
LVL 1

Expert Comment

by:Sachin_Yash
ID: 10865856
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
ID: 10877544
Yeah, it's such a strange way! No CD and floppy!
I'll try it!
0
 

Expert Comment

by:roks1957
ID: 11987310
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

910 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

20 Experts available now in Live!

Get 1:1 Help Now