2

I am using Redhat Linux 5. I forgot the root password i set while installing linux OS. After rebooting right after the installation, entering root password is needed of course. So the following is what i did: I couldn't reset root password from "grub" after booting using single user mode. After writing command "passwd",instead of asking to input new unix password,it went like:

"changing password for user root. passwd: authentication token manipulation error"

It skips the following

"Asking to input root password. Then it returns authentication token manipulation error"

Any idea why it is doing so? This is the first time i do resetting root password via grub. The parameter i passed are "single" and "selinux=0" to disable SELINUX policy loading since it was halting when the SELINUX is not disabled.

enter image description here

7
  • Did you edit the boot options and add init=/bin/bash to the boot entry? Commented Oct 23, 2017 at 11:22
  • What did you do to get error “Asking to input root password. Then it returns authentication token manipulation error” Commented Oct 23, 2017 at 11:26
  • 2
    related to askubuntu.com/questions/57620/… type mount check mount options is it rw. Commented Oct 23, 2017 at 11:31
  • @RamanSailopal , I now tried to append the boot entry by the following: 1) init=/bin/bash 2) then pressed enter 3) at bash prompt did : mount -n -o remount,rw / 4) Tried to reset password using "passwd" I am still getting the same error as the attach file shows above. Commented Oct 23, 2017 at 20:34
  • @ctrl-alt-delor "Asking to input root password" was not the error. After using "passwd" command , it should ask me to input the new root password. But it didn't. Instead, it gives "authentication token manipulation error without asking me to give root password (reset password). Commented Oct 23, 2017 at 20:37

5 Answers 5

1

Your system is lock or mount in (ro)

  1. other linux is boot
  2. mount your system root mount /dev/sda /mnt (rw)
  3. chroot /mnt
  4. passwd root
  5. reboot
2
  • 1
    What do you mean by "other linux is boot". I am confused. Commented Oct 23, 2017 at 20:45
  • Other linux = Live CD . My english is bad))) Commented Oct 22, 2024 at 12:10
1

Boot your system the press e to edit grub;

Change the ligne:

ro rhgb quiet 

to

 rw init=/sysroot/bin/sh 

Press Ctrl + X to boot

From the root shell type:

chroot /sysroot 

Disable selinux

setenforce 0 

To change the root password type

passwd root 

Type your password twice . To change the user password:

passwd user 

Update the selenux file

touch /.autorelabel 

Type

exit reboot 

To update the selinux file , it will take a few minutes at:

relabeling could take a very long time depending on file 

then it will reboot

0

This answer assumes RHEL5 and also assumes that SELINUX is not enabled.

  1. At the boot loader (GRUB) menu select (highlight) the kernel you wish to boot into using the arrow keys if you have more than one kernel or OS menu item.
  2. Type A to enter into append mode.
  3. Press the spacebar once to add a space.
  4. Type the word "single" to tell GRUB to boot into single-user.
  5. Press enter and GRUB will boot you into single-user mode with root privledges.
  6. Now you can successfully run the passwd root command.
8
  • Meh! after doing this i am getting the issue above. Check the attached file. I reached step 6. Done "passwd" to reset the password , then as you can see in the attached file, it is not accepting any input from me to reset the password. Please look at the attached file. Commented Oct 23, 2017 at 20:47
  • @Mussa. What attached file? Commented Oct 24, 2017 at 0:17
  • @Mussa. At the single user prompt, please run pwck and grpckand cat /etc/shadow | grep root and cat /etc/passwd | grep root and provide output Commented Oct 24, 2017 at 0:24
  • In below comments , I am going to send you the output of each command Commented Oct 24, 2017 at 15:42
  • # pwck user adm: directory /var/adm does not exist user news: directroy /etc/news does not exist user uucp: directory /var/spool/uucp does not exist user gopher: directory /var/gopher does not exist user ftp: directory /var/ftp does not exist user pcap: directory /var/arpwatch does not exist user sabayon: directory /homme/sabayon does not exist pwck: no changes Commented Oct 24, 2017 at 15:42
0

This happens when your file system is read only

mount -rw -o remount / 
1
0

The "authentication token manipulation error" you're encountering typically occurs when the root filesystem is mounted as read-only. This is a common issue when attempting to reset passwords in single-user or rescue mode.

Here's the complete solution for RHEL 5:

  1. Boot into single-user mode by pressing 'e' at the GRUB menu
  2. Modify the kernel line - append single or init=/bin/bash to the end
  3. Press Enter, then 'b' to boot
  4. Remount the filesystem as read-write:
    mount -o remount,rw / 
  5. Verify it's mounted as rw:
    mount | grep " / " 
  6. Now reset the password:
    passwd root 
  7. If SELinux is enabled, you'll need to relabel:
    touch /.autorelabel 
  8. Reboot:
    sync reboot -f 

The key issue in your case was that the filesystem was still mounted as read-only (ro), which prevented the /etc/shadow file from being modified. The mount -o remount,rw / command fixes this.

For a detailed walkthrough with screenshots and additional troubleshooting tips for Red Hat systems (RHEL 6/7/8/9), you can refer to this comprehensive guide: How to Recover Root Password in Red Hat Linux Systems

Important security note: After gaining access, consider why physical security matters - anyone with physical access to the machine can reset passwords unless you implement GRUB password protection or full-disk encryption.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.