Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Kelvin on April 30, 2002, 02:47:15 PM

Title: Recreating Users After Crash
Post by: Kelvin on April 30, 2002, 02:47:15 PM
Hi All,

If anyone can help me with this I'd be really grateful.

I have one SME server develop HDD problems and crashed. A reboot forced me to do a manual fsck which I did (and just saying yes to all errors encountered and when prompted to fix). Some folders and files ended up being deleted which left me with a server that only just manages to boot up (with some errors about missing folders or files).

I managed to get to the console prompt and have managed to copy out the smbpasswd file from /etc. All I really care about is the usernames and pseudonyms and not any ibays or files (there are none to begin with). I am going to replace the HDD and rebuild but would like to put back all the accounts and pseudonyms and passwords.

Is there a way to do this with the smbpasswd file I copied (or another file from the old server hdd -- while I still have it going ?) ?

Thanks.

Kelvin
Title: Re: Recreating Users After Crash
Post by: Jon Blakely on May 01, 2002, 12:23:46 PM
Of course you could always just rebuild the system and re-install from the backup you create regularly :-)

Jon
Title: Re: Recreating Users After Crash
Post by: Kelvin on May 01, 2002, 01:27:12 PM
Backups --- Har ! Har ! Backups --- Ho ! Ho ! Ho !.

Now, seriously. Worst case scenario. I can access most of the files (as and when I manage to boot up to the prompt). The manual fsck process deleted some files and folders which impacts on some services -- don't care about the services. I need to know if there is a way if I can recreate the users from the files I can still access.

Obviously, the password files provide me with the usernames in clear text but the passwords are encrypted. The qmail assign file gives me the pseudonyms as well. Assuming I still can copy out ALL the necessary files, which ones do I need (if it is even possible at all) to copy to the rebuilt server so that the accounts are recreated (with passwords intact) ?

Kelvin.
Title: Re: Recreating Users After Crash
Post by: Jon Blakely on May 01, 2002, 02:54:45 PM
Ok seriously,

Have you still got /home/esmith/accounts /home/esmith/configuration
These are your configuration and accounts databases.

/etc/passwd and /etc/passwd-   contain more user info
/etc/shadow and /etc/shadow-   contain user passwords in a hash

I know I trashed my accounts dbase once and was able to copy a new one from a backup file and it worked fine.

Jon