View previous topic :: View next topic |
Author |
Message |
tuxamd Apprentice
Joined: 28 Jan 2005 Posts: 281
|
Posted: Fri Jan 28, 2005 8:24 am Post subject: [solved :)] accidently deleted /etc/passwd |
|
|
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 |
|
|
Keiss n00b
Joined: 19 Sep 2004 Posts: 43 Location: Prague, Czech Republic
|
Posted: Fri Jan 28, 2005 8:55 am Post subject: |
|
|
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 |
|
|
trentin n00b
Joined: 22 Dec 2004 Posts: 14 Location: Bratislava, Slovakia
|
Posted: Fri Jan 28, 2005 8:58 am Post subject: |
|
|
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 |
|
|
tuxamd Apprentice
Joined: 28 Jan 2005 Posts: 281
|
Posted: Fri Jan 28, 2005 8:58 am Post subject: |
|
|
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
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 |
|
|
Keiss n00b
Joined: 19 Sep 2004 Posts: 43 Location: Prague, Czech Republic
|
Posted: Fri Jan 28, 2005 9:04 am Post subject: |
|
|
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 |
|
|
tuxamd Apprentice
Joined: 28 Jan 2005 Posts: 281
|
Posted: Fri Jan 28, 2005 9:11 am Post subject: |
|
|
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 |
|
|
|