Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Red Hat This forum is for the discussion of Red Hat Linux.


  Search this Thread
Old 08-10-2011, 10:25 AM   #1
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 620

Rep: Reputation: 31
how to change root passwd (if forgotten)

I ve forgotten my root passwd on centos 6,

I tried to change it as I used in debian (in debian it works perfectly) , that is:

use a cd live (or installation cd1), to access the hd,
I mount my root partition and mount proc and devices

I tried the command passwd, no error reprorted, but after reboot the passwd hadīt changed.
then I decided to remove passwd from /etc/shadow (delete the
second field).

OK, now I can access my machine without passwd, BUT I CANīT GIVE ANY PASSWORD!!!! I RECEIVE THIS ERROR

# passwd
Changing password for user root.
New password:
Retype new password:
passwd: Authentication token manipulation error

any idea to fix the problem.
thanks a lot
Old 08-10-2011, 10:38 AM   #2
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295

The easy way is to boot into single user mode. In the boot screen you have a couple of seconds to type any key to enter into the grub menu. Choose the line you want to edit (most likely the first) and type 'e' (without the quotes). Next select your kernel boot line and type 'e' again. On that line at the end add the word 'single' (again without quotes), type <enter> and next 'b' to boot. You'll be logged in on a single user mode and will be able to run passwd to reset the root passwords. After that change run level or reboot.

That's the normal, fastest and easiest way on CentOS that I know of. But... Most likely your /etc/shadow has been corrupted so you might want to have a look at:
man pwconv
to try and save the day if the first option doesn't work for you.

Kind regards,



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
root cannot change root passwd kamariz Linux - General 6 01-18-2012 06:49 AM
I Have Forgotten the Root Password & Need To Change It balamuruganram Linux - General 3 07-02-2010 07:07 AM
trying to change root password with the passwd command he04798 Red Hat 5 01-17-2010 11:01 AM
Forgotten Webmin login passwd, how to remove it MTT1k Linux - Networking 1 12-19-2005 04:55 PM
MDK 9: Cannot boot into linux single to chage forgotten root passwd acadcworks Linux - Security 1 12-18-2002 10:24 AM > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 04:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration