Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reset root password - How-to?

Posted on 2003-11-20
7
Medium Priority
?
66,087 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 375 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.
Suggested Courses

730 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