LinuxQuestions.org
Help answer threads with 0 replies.
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 01-11-2016, 05:28 AM   #1
sysahamed
LQ Newbie
 
Registered: Jan 2016
Posts: 1

Rep: Reputation: Disabled
Question Recover system if /etc/passwd file deleted?


Hi guys,

I have suppose accidentally deleted my /etc/passwd file in a Redhat host & there is no backup. How do i recover the system now? I googled & came across solution like /etc/passwd- file exists as a backup & we can recover using that. Is that /etc/passwd- file exists in all flavours of Linux? I remember like have checked in Suse LINUX but that backup file does not exist. Need your clarification on this, whether recovery using that file is always possible(is that file exists in redhat as standard?) & incase if that file doesn't exist, how to recover?

Thanks,
Ahamed
 
Old 01-11-2016, 10:01 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
If you're running RHEl, you should be paying for support instead of asking us.
In your honour, I booted Fedora and checked. /etc/passwd- DOES exist. Use it.
 
Old 01-18-2016, 07:16 AM   #3
Texbian
LQ Newbie
 
Registered: Jan 2016
Location: Texas
Distribution: RHEL, Solaris
Posts: 1

Rep: Reputation: Disabled
Hi sysahamed,

Boot into single user mode. If you are successful, you'll be logged in as root. From there you can build a new /etc/passwd. You will need to have a file from the same distro to use as a template and you'll have to be able to use a console-based editor. Once ou build a new and good passwd file, make a backup :-)
 
Old 01-18-2016, 07:41 AM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by business_kid View Post
If you're running RHEl, you should be paying for support instead of asking us.
Just to clarify this, Red Hat offers subscriptions without support, so Red Hat questions are totally valid here. After all, we wouldn't need a Red Hat subforum otherwise.
 
  


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
How to recover a deleted file using the ext3 file system wdhpr Linux - Newbie 6 01-11-2011 10:04 PM
[SOLVED] Deleted root from passwd and shadow file adloaiz Linux - Newbie 1 10-07-2010 01:34 PM
Trying to recover a deleted file. mckinnon81 Linux - Newbie 1 05-02-2010 10:56 PM
how to recover /etc/passwd file narayanapalla Linux - Newbie 8 04-15-2010 03:46 PM
LXer: HOWTO recover deleted files on an ext3 file system LXer Syndicated Linux News 0 03-14-2008 01:11 PM

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

All times are GMT -5. The time now is 06:16 PM.

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