Solved

Reset root password - How-to?

Posted on 2003-11-20
7
66,049 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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.

770 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