The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
grep unix.com with google



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-25-2009
Registered User
 

Join Date: Oct 2009
Posts: 27
Accidental deletion of root account

I had created a root account when I installed the Centos 5 into my system.

But now the problem I'm facing is that I accidently deleted the root user account in my system.

Is there a way to recreate the root account in the system now, without reinstalling the OS?

Pls help.
  #2 (permalink)  
Old 11-26-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
 

Join Date: Dec 2008
Location: .at
Posts: 2,583
How did you delete the root account? Do you still have an open session for root?

If not, you'll have to boot using the installation media to "Rescue Mode" (or something similar). Mount the root device of the system as read-write.

In both cases, add/modify the line for root in /etc/passwd to read (change the shell if needed)
Code:
root:x:0:0:root:/root:/bin/bash

and this line for /etc/shadow (enter the second field EXTACTLY as shown:
Code:
root:$1$UbSkbnqO$Wjpj2enKcnl8q8dLRjezq/:14574:0:99999:7:::

This should reset the password for root to "p4ssw0rd" (without the quotes, that's a zero, not an uppercase O)
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Root account! jofonseca99 UNIX for Dummies Questions & Answers 4 09-21-2009 03:40 PM
Can't login root account due to can't find root shell neikel AIX 2 01-30-2008 11:07 PM
Account Deletion... spaceshiporion Post Here to Contact Site Administrators and Moderators 2 06-24-2005 08:36 PM
Root account is expired mallesh UNIX for Advanced & Expert Users 2 06-22-2005 11:46 AM
root account has been locked Maker AIX 1 04-15-2004 10:25 AM



All times are GMT -4. The time now is 10:03 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0