openSUSE Forums > Install/Boot/Login » /etc/passwd deleted

Go Back   openSUSE Forums > Install/Boot/Login
Forums FAQ Members List Search Today's Posts Mark Forums Read

Install/Boot/Login Questions about installation, login, boot issues, partitioning, file systems, software that runs at boot (GRUB, LILO, boot scripts)

Reply
Page 1 of 2 1 2
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-Jul-2009, 07:29
ionpetrache's Avatar
Student Penguin
 
Join Date: Jun 2009
Location: Timisoara, Romania
Posts: 82
ionpetrache hasn't been rated much yet
Exclamation /etc/passwd deleted

Hello all,

I accidentally deleted the /etc/passwd file from my OpenSuse10.3.
What can I do to get back in my OS?
Thanks
Reply With Quote
  #2 (permalink)  
Old 08-Jul-2009, 07:38
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,700
BenderBendingRodriguez hasn't been rated much yet
Default Re: /etc/passwd deleted

I don't know how it is about in 10.3 but you should have a passwd.old in there or passwd.Yast2save. copy that and rename to passwd. After that you'd need to add your user with YaST again as it won't probably be there.
__________________
How does a linux geek make love??

- rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;
Reply With Quote
  #3 (permalink)  
Old 08-Jul-2009, 07:42
brassy
Guest
 
Posts: n/a
Default Re: /etc/passwd deleted

> I accidentally deleted the /etc/passwd file from my OpenSuse10.3.
> What can I do to get back in my OS?


there may be another way, but the only way i know is to restore it
from your latest backup tape/image..

--
brassy
Reply With Quote
  #4 (permalink)  
Old 08-Jul-2009, 08:00
hcvv's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Netherlands
Posts: 2,299
hcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enough
Default Re: /etc/passwd deleted

Quote:
Originally Posted by BenderBendingRodriguez View Post
I don't know how it is about in 10.3 but you should have a passwd.old in there or passwd.Yast2save. copy that and rename to passwd. After that you'd need to add your user with YaST again as it won't probably be there.
I have both in 10.3. So look inside wich one comes nearest (and look at their dates how old they are) to what you think your original was (in fact my passwd.old is exactly the same as passwd, so maybe you do not need to change something).
__________________
Henk van Velden
Reply With Quote
  #5 (permalink)  
Old 08-Jul-2009, 08:02
hcvv's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Netherlands
Posts: 2,299
hcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enough
Default Re: /etc/passwd deleted

And I have a vague idea that you might be interested in reading: SDB:Login as root - openSUSE
__________________
Henk van Velden
Reply With Quote
  #6 (permalink)  
Old 08-Jul-2009, 08:05
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,700
BenderBendingRodriguez hasn't been rated much yet
Default Re: /etc/passwd deleted

Well i compared mine passwd.old and passwd and i didn't have the actual user, i guess it is made every time there are any changes. So if you only added one user then in the passwd.old you won't have that user in it BUT if you made some other changes then you should have yourself in there

P.S. So after copying and renaming look into that file, if your actual user doesn't exist then recreate him with YaST.Simple
__________________
How does a linux geek make love??

- rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;
Reply With Quote
  #7 (permalink)  
Old 08-Jul-2009, 08:09
ionpetrache's Avatar
Student Penguin
 
Join Date: Jun 2009
Location: Timisoara, Romania
Posts: 82
ionpetrache hasn't been rated much yet
Default Re: /etc/passwd deleted

But I don't know how can I log in to my system because at login window after typing my user and password an error message is displayed "Login failed". How can I bypass the login.

thanks!
Reply With Quote
  #8 (permalink)  
Old 08-Jul-2009, 08:13
BenderBendingRodriguez's Avatar
Wise Penguin
 
Join Date: Jun 2008
Posts: 1,700
BenderBendingRodriguez hasn't been rated much yet
Default Re: /etc/passwd deleted

Use any live CD to copy passwd.old and rename it to passwd. DVD will also suffice, just go to other terminals.
__________________
How does a linux geek make love??

- rtfm; unzip; strip; touch; finger; mount; fsck; more; yes; umount; zip; sleep;
Reply With Quote
  #9 (permalink)  
Old 08-Jul-2009, 08:13
hcvv's Avatar
Global Moderator
 
Join Date: Jun 2008
Location: Netherlands
Posts: 2,299
hcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enoughhcvv 's reputation will be famous soon enough
Default Re: /etc/passwd deleted

Either by booting into single user mode (enter s in the options field during boot), or use a cd/DVD in rescue mode.

Edit: orr a live CD as BenderBendingRodriguez says (we are fighting being first to answer you, see what you did to us ).
When boot is finished and you are loged in in the console after the boot (from live CD or whatever), mount the roor partition of your normal system somewhere, then you go there with cd and see what you have in etc/.
__________________
Henk van Velden
Reply With Quote
  #10 (permalink)  
Old 08-Jul-2009, 09:03
ionpetrache's Avatar
Student Penguin
 
Join Date: Jun 2009
Location: Timisoara, Romania
Posts: 82
ionpetrache hasn't been rated much yet
Default Re: /etc/passwd deleted

I tried to boot with s option but after switching to runlevel s I got some errors about services that could not start in runlevel s and also a message sulogin: cannot open password database.

I'll try with an liveCD but this way (single user mod) it could be easier for me becouse I don't have a liveCD right now.

Thank you very much ... both of you!

Quote:
Originally Posted by hcvv View Post
Either by booting into single user mode (enter s in the options field during boot), or use a cd/DVD in rescue mode.

Edit: orr a live CD as BenderBendingRodriguez says (we are fighting being first to answer you, see what you did to us ).
When boot is finished and you are loged in in the console after the boot (from live CD or whatever), mount the roor partition of your normal system somewhere, then you go there with cd and see what you have in etc/.
Reply With Quote
Reply
Page 1 of 2 1 2

Bookmarks

Tags
/etc/passwd


Thread Tools
Display Modes

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 On




 

Search Engine Friendly URLs by vBSEO 3.3.2