LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


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

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


Hi,
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
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

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:
Code:
man pwconv
to try and save the day if the first option doesn't work for you.

Kind regards,

Eric
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 03:58 AM.

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