1756689 Members
2953 Online
108852 Solutions
New Discussion юеВ

Re: Reset root password

 
Cliff Lim Kok Hwee
Regular Advisor

Reset root password

Hi Forumers,

Currently running RedHat 4.0 and the root password had been changed accidentally.

Anyway to have it change during a reboot?

Thanks/cliff
8 REPLIES 8
Maaz
Valued Contributor

Re: Reset root password

boot the system in runlevel 1. and then reset the root passwd. Linux system doesnt ask for root passwd when booting in runlevel 1

Hope this will help
Regards
Maaz
Ajay Agarwal
Frequent Advisor

Re: Reset root password

Boot the system in single-user mode and change the root passwd.

Steps to boot into single-user mode:

If you are using GRUB, use the following steps to boot into single-user mode:


If you have a GRUB password configured, type p and enter the password.

Select Red Hat Linux with the version of the kernel that you wish to boot and type e for edit. You will be presented with a list of items in the configuration file for the title you have selected.

Select the line that starts with kernel and type e to edit the line.

Go to the end of the line and type single as a separate word (press the [Spacebar] and then type single). Press [Enter] to exit edit mode.

Back at the GRUB screen, type b to boot into single-user mode.

If you are using LILO, at the LILO boot prompt (if you are using the graphical LILO, you must press [Ctrl]-[x] to exit the graphical screen and go to the boot: prompt) type:

linux single
Jees Joy
Frequent Advisor

Re: Reset root password

Reboot the box in runleve one and issue the command "passwd root" give your new password.
Vipulinux
Respected Contributor

Re: Reset root password

Hi

Do the following:

Boot using cd:
at boot prompt do:
linux rescue
thenb
chroot /mnt/sysimage
passwd
(give new password)

Cheers
Cliff Lim Kok Hwee
Regular Advisor

Re: Reset root password

Hi Forumers,

I had managed to login to server and change the root access.

Using command prompt I am able to useradd and groupadd etc.

But when running the GUI User and Group I got the following error messages

"The user database cannot be read" This problem is most likely caused by a mismatch in /etc/passwd and /etc/shadow. The program will exit now.

I checked the /etc/passwd and /etc/shadow but no mismatch to the users account.

Please advise me.

Thanks/cliff
Vipulinux
Respected Contributor

Re: Reset root password

Hi
Please run the consistency check on the passwd and shoadow file ..give the foll command:

pwdck and
grpck

Cheers
Ivan Ferreira
Honored Contributor

Re: Reset root password

Check for a file in /etc called:

pass*.lock
shad*.lock

This file may be preventing the access to the files.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Ajay Agarwal
Frequent Advisor

Re: Reset root password

Try pwck and pwconv cmd.
Read the man page for "pwck" then "pwconv".
Scan /etc/login.defs