Rebuilding users, home dirs and virtual dirs

LawsHosting

Verified User
Joined
Sep 13, 2008
Messages
2,442
Location
London UK
OS: Debian 6.

So, my hard drive crashed :( .. Had 90% backed up, however I've 5 users that I was unable to backup from DA in time. I still have them in the /usr/local/directadmin/data/users dir, and have their /home/ dirs in a rar file, and their mysql databases in another but the raw files.

Is there a way to recreate the users in the system (adduser? i've the /etc/passwd file but guess that's useless), /etc/virtual/*, /home/* directories? So I can just manually untar to /home/.

Can this be done?

I see http://help.directadmin.com/item.php?id=66, but I don't want to rebuild the lot
 
Hello,

1) First, rename /home/username to something else, until after the next step (if it already exists, with data)
Backup other data too.

2) Then remove the user from /etc/passwd with:
userdel -r username

3) Then create the User through DA normally, and it will do all of the heavy lifting for you.

4) Copy whatever data you do have back to where it used to live.

5) Reset permissions:
http://help.directadmin.com/item.php?id=173

John
 
Ok, had to remove a reseller as their /home/ etc was empty (which would be, as I didn't back it up), however, in /usr/local/directadmin/scripts/custom/user_destroy_pre.sh I have:
if [ "$username" == "blah" ]; then{
echo "You are not allowed to delete user $username";
exit 1;
}
fi;
I forgot I had this for security, however, when I deleted this reseller, it complained but it STILL deleted the reseller's data in /data/users/, but was still listed on CMD_RESELLER_SHOW under admin with "No data to show".

Surely, this isn't meant to happen?
 
Last edited:
Back
Top