Reset /Users/X in MacOSX

http://www.macosxhints.com/article.php?story=20081009204908181&mode=print

#!/bin/bash

if [ ! -n “$1” ]; then
echo $0: user
exit 1
fi

sudo chown -R $1:staff /Users/${1}
sudo chmod -R 700 /Users/${1}
sudo chmod 755 /Users/${1}
sudo chmod -R 755 /Users/${1}/Public /Users/${1}/Sites
sudo chmod -R 733 /Users/${1}/Public/Drop Box
sudo chmod +a “everyone deny delete” /Users/${1} /Users/${1}/Sites /Users/${1}/Public /Users/${1}/Desktop
/Users/${1}/Documents /Users/${1}/Downloads /Users/${1}/Pictures /Users/${1}/Music /Users/${1}/Movies
/Users/${1}/Library
sudo chmod -R +a “${1} allow readattr,readextattr,readsecurity,list,search,read,execute,file_inherit,directory_inherit,delete,writeextattr,writeattr,write,append,delete_child,add_file,add_subdirectory”
/Users/${1}/Public/Drop Box

Leave a Reply

Your email address will not be published. Required fields are marked *