Say you have a new machine, and it is not on NIS or LDAP, it needs to be really secure and only have local accounts. So you need to make a bunch of local accounts, but you need to leave for lunch in a half hour. Well simply use this short simple script to make them and set the proper permissions in a matter of seconds. Below is a sample script, I suggest calling is something like createuserhomedir.sh. We are assuming that there is a file called users which has all the user’s name that we want to make in the same directory as the script.
echo “echoing users”
echo “end echoing users”
echo “Making Home Directories”
for i in `cat ./users`
echo “Fixing Permissions For $i Home DIR’s”
chown -R $i:other /export/home/$i