1

A user's login/account information was deleted and is no longer listed under "accounts" in System Prefs on the Mac OS X Client.

Their home folder is still present in /Users/

Anyone know what happens if we just create a new user with the same name? Will it assume that user's home folder? or will it append "1" to the new account name & folder?

How could we go about re-activating this user?

Thanks for the help

3 Answers 3

3

OS X has a script called createhomedir that gets run at login to check for the existance of and make a users home directory as required. Off the top of my head I'm not sure what the behaviour is when it encounters a pre existing home directory.

You're probably safe just adding the new user and then changing the ownership on the old home directory. As long as the user doesn't login it's likely it won't be overwritten. To be sure, however, its a good idea to move it out of the way just in case. Once the user is made, remove anything that gets created automatically and move the old directory back. You should avoid having them login until you're done.

It's likely that the user's new uid won't match their old one, so their home directory won't be owned by them. You can fix that up with a chown:

chown -R <user> /Users/<user-home>

1

At least in Mac OS X v10.5 (and I think 10.4 as well, but I don't remember for sure) the approach you're thinking of will work: just use System Prefs to create a new user with the same short name, and it'll ask if you want to use the existing home folder. If you say yes, it builds the new account, and chowns the home folder to the new user. (Mind you: making a backup first is almost always a good idea, especially when acting on the advice of some random joker on the internet...)

There are a few limitations: if the new user's password isn't the same as the old one, the user's login keychain won't automatically unlock when they log in (you can change this in Keychain Access). Also, the new user won't have their Public and Sites folders set up for file and web sharing, respectively (if you care, clone & adjust some other user's config files in /var/db/dslocal/nodes/Default/config/SharePoints/ and /etc/apache2/users/).

0

I'm not sure about this exact situation, but I can tell you that I've definitely done the reverse. We've renamed a users home folder to match and existing user accounts shortname. You could probably rename the user's home folder to some temporary name to make sure that it doesn't get written over. Then you could create the account, log back in as another admin user(or root) and swap the user folders.

edit: You may need to run the chown command noted above if you see errors wiht permissions after doing this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .