Solved

Reset root password - How-to?

Posted on 2003-11-20
7
66,071 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

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.…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

729 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