Operating System - Linux
1819684 Members
3530 Online
109605 Solutions
New Discussion юеВ

how to reset the root password on Linux RedHat Advenced Server

 
GNOM
Frequent Advisor

how to reset the root password on Linux RedHat Advenced Server

Hi,

How can I Reset the Linux RedHat Advenced Server root password on DELL PowerEdge 2650 ?

thnaks for helping me.
8 REPLIES 8
Ivan Ferreira
Honored Contributor

Re: how to reset the root password on Linux RedHat Advenced Server

Maybe, you can still reboot the server using ctrl+alt+del, or you may issue the reboot command, it depends of the security settings applied. If you can't gracefully reboot the server, restart it manually hard resetting the server.

At the GRUB prompt, press "a"
Then type in single
Then ENTER

You will start the server in single user. You can use the passwd command.

If the "a" is not available, Select the kernel that you want to boot, and press "e".

Edit the kernel entry and add the word single to the parameters.

Press "b" to boot the kernel.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Stuart Browne
Honored Contributor

Re: how to reset the root password on Linux RedHat Advenced Server

Hrm, I thought 'single' mode still asked for the root password to mount the filesystems..

If it does, then see if you can scrounge up a first CD of the install set (of this OS or any of the fedora's), and boot up in 'rescue' mode. 'chroot /sysimage', and then use 'passwd' to change the password.
One long-haired git at your service...
Ivan Ferreira
Honored Contributor

Re: how to reset the root password on Linux RedHat Advenced Server

Single user boots directly to the shell, and with all file systems mounted. If you don't want to mount file systems, you need to use emergency or change the init= program.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Pau Garcia i Quiles
Frequent Advisor

Re: how to reset the root password on Linux RedHat Advenced Server

If you have a boot disk with whatever operating system that can mount your root filesystem (for instance, a Knoppix CD would do), just boot it, mount the filesystem read-write and go to the file /etc/shadow. You'll have a line like this:

root:$1$K.E7S.3T$u.yijiy92l./q.ALX5a6n1:13115:0:99999:7:::

Remove the text between the first two ":" and leave the line like this:

root::13115:0:99999:7:::

Unmount the filesystem and reboot without the boot disk. Now the root account will not ask for a password. Set it immediately with the "passwd" command and you're done.

Asif Sharif
Honored Contributor

Re: how to reset the root password on Linux RedHat Advenced Server

Hi Buddy !!!

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

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

2. 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.

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

4. 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.

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

6. After that issue the command "passwd root" give your new password.

Regards,

Asif Sharif
Regards,
Asif Sharif
Steven E. Protter
Exalted Contributor

Re: how to reset the root password on Linux RedHat Advenced Server

Good thread people.

This one goes in my bookmarks.

Nothing more to add. Give the contributors bunny.

Shalom GNOM

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Asif Sharif
Honored Contributor

Re: how to reset the root password on Linux RedHat Advenced Server

Hi GNOM,
I have assigned points to 0 of 21 responses to my questions. Please assign points who helped you.

Regards,
Asif Sharif
Regards,
Asif Sharif
gatouillat
Occasional Advisor

Re: how to reset the root password on Linux RedHat Advenced Server

Hello,

I think the best will be to add init=/bin/bash at the end of the kernel line in Grub. Under other distribution like Debian, the single mode prompt you for the password. With init=/bin/bash, no prompt for password.

Regards,
Pierre-Damien / SCC