Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved :)] accidently deleted /etc/passwd
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
tuxamd
Apprentice
Apprentice


Joined: 28 Jan 2005
Posts: 281

PostPosted: Fri Jan 28, 2005 8:24 am    Post subject: [solved :)] accidently deleted /etc/passwd Reply with quote

I know this sounds extremely stupid but I it's late and I wasn't paying attention, accidently typed rm instead of cat. Is there anything I can do to get it back? I really haven't created any new user names other than those that come with the installation. If I copy it from my other box will I have issues with user ids? Is there a way to recover the file? Oh, and btw I'm using reiserfs 3.6.

Last edited by tuxamd on Fri Jan 28, 2005 9:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Keiss
n00b
n00b


Joined: 19 Sep 2004
Posts: 43
Location: Prague, Czech Republic

PostPosted: Fri Jan 28, 2005 8:55 am    Post subject: Reply with quote

I think you can copy the passwd file over, and look up you users uid by looking in his home dir (ls -l) and set it in the passwd file if its different. There could be missing some usernames if you installed some services (for example proftpd,...).
Back to top
View user's profile Send private message
trentin
n00b
n00b


Joined: 22 Dec 2004
Posts: 14
Location: Bratislava, Slovakia

PostPosted: Fri Jan 28, 2005 8:58 am    Post subject: Reply with quote

you can boot from the livecd, and add all if the users you need into the livecd. thus, you will crate almost an exact passwd file as you had. now just mount your / partition in the livecd, copy the /etc/passwd file and you're all set
_________________
http://speedmonkey.net - life from a more interesting point of view
Back to top
View user's profile Send private message
tuxamd
Apprentice
Apprentice


Joined: 28 Jan 2005
Posts: 281

PostPosted: Fri Jan 28, 2005 8:58 am    Post subject: Reply with quote

So far all I did was ntp and mysql/apache/php though I haven't really ran them yet. I see the apache is in the default passwd file, do you think anything else would get effected?

Hehe unfortunately this is remote so booting into livecd is kind of tough :lol:

Though I'm still logged in :) Which is why I posted to be very cautious because I know once Iog out or mess anything up it will only make things harder.

Don't you just hate the feeling when you realize you just made such a mistake?


Last edited by tuxamd on Fri Jan 28, 2005 9:07 am; edited 1 time in total
Back to top
View user's profile Send private message
Keiss
n00b
n00b


Joined: 19 Sep 2004
Posts: 43
Location: Prague, Czech Republic

PostPosted: Fri Jan 28, 2005 9:04 am    Post subject: Reply with quote

tuxamd wrote:
So far all I did was ntp and mysql/apache/php though I haven't really ran them yet. I see the apache is in the default passwd file, do you think anything else would get effected?

apache and mysql use special user accounts.
Code:

mysql:x:60:60:mysql:/var/lib/mysql:/bin/false
apache:x:81:81:apache:/home/httpd:/bin/false
Back to top
View user's profile Send private message
tuxamd
Apprentice
Apprentice


Joined: 28 Jan 2005
Posts: 281

PostPosted: Fri Jan 28, 2005 9:11 am    Post subject: Reply with quote

Alright, that did the trick. I just borrowed the whole file from my local gentoo box since it's recently been installed. Thanks for your replies.

Valuable lesson learned :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum