How To Delete All User from Terminal

I am giving my Mom my PM G5 and want her to have the 'out of box' experience. Got Family Pack for $165 through corporate discount.

I need the input for deleting users inserted in the inputs below....

/sbin/fsck -yf
/sbin/mount -uw /
rm /private/var/db/.AppleSetupDone
shutdown -r now

Leopard seems to be different than Tiger so the references I've found on this subject don't work i.e.,

cd /Users
rm -rf *

or rm -rf /Users/my accountname

Thanks for your help!

iMac Intel Core 2 2.4GHz, Mac OS X (10.5), +G5 D1.8 & PB 1.5 G4

Posted on Nov 1, 2007 9:45 AM

Reply
Question marked as Top-ranking reply

Posted on Nov 1, 2007 10:07 AM

If you want the "out of the box experience", do an erase and install off the Leopard disk. After the installation has finished and the computer restarts, when it prompts you to put in your information, don't and do a hard shut down by holding the power button down for 5 seconds. Start it back up to make sure it worked, it should prompt you again to input your information, as if it is brand new and just out of the box. Just shut it down again and give it to her.
7 replies
Question marked as Top-ranking reply

Nov 1, 2007 10:07 AM in response to bmyers2@mac.com

If you want the "out of the box experience", do an erase and install off the Leopard disk. After the installation has finished and the computer restarts, when it prompts you to put in your information, don't and do a hard shut down by holding the power button down for 5 seconds. Start it back up to make sure it worked, it should prompt you again to input your information, as if it is brand new and just out of the box. Just shut it down again and give it to her.

Nov 1, 2007 6:33 PM in response to Eric Schmitt

I kept digging around here... There are a lot of posts regarding the blue screen issue as well as some issues at boot post install relating to Filevault....

So I just tried the commands below on my PM G5 and it seems to have accomplished what I was looking for.

Restart in Single User mode (hold Command-S during startup). At the :/ root# prompt:

/sbin/fsck -fy
/sbin/mount -uw /
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServicesLocal.plist
dscl . -delete /Users/[username]
rm -rf /Users/[username]
rm /private/var/db/.AppleSetupDone
reboot

I did this on my Powerbook by creating a secondary login and it worked there too although I received some unexpected comments about having to enter the 'launchctl' string even though I already had. It also told me to add the 'local' to the end....

From the Apple Support doc linked below, it only showed 'launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist.' Notice there is no 'local' included.

http://docs.info.apple.com/article.html?artnum=306840

I have no idea if this is bad for my system and make no warranty about its use. I performed this on a clean install with only the ATI control panel and a couple other applications that could easily be reinstalled had this hosed my system beyond repair.

Nov 1, 2007 2:44 PM in response to Eric Schmitt

Thanks Eric. This does seem to be a puzzle and I've read other posts from enterprise users who want to give a modified yet 'out of box' Mac to an employee. Something to do with how there is no netinfodb in Leopard.

rm -r /users/<username> will delete the home folder but doesn't remove the user account from showing in the System Preferences. Sure I could register as 'test,' install all the additional applications and hand it over- after she registers, I could show her how to delete the 'test' account in Sys Prefs.... But would like to figure this out if it is possible - it's more about the technical challenge than taking the easy route. I googled the sudo dscl command and will look more into that although at first glance, requires a remote access to the machine.

I would think someone selling a Mac would also be interested in something like this.

Nov 1, 2007 12:05 PM in response to bmyers2@mac.com

It seems like you're making this harder than it needs to be...

Just put her info in and install the programs you want to give her and then give it to her. Or give her the computer and then install them for her after she has filled out everything. I guess I don't understand what experience you want her to have...filling out the beginning info isn't really that special...

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How To Delete All User from Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.