Thanks for sharing your code snippets, mweinber and cactus.
seeing we have a production server with more than 650 user accounts, staff and pupils, all in /home/e-smith/files/users/ I was rather hoping to pass a file to a script. The file will contain pupil user names, one per line. I will have to manually produce the list by removing staff from a complete user list.
I'm not very good at this, but if I were to modify your code, mweinber, to the following:
for USER in `path_to_pupil_user_list_file`;\
do \
chgrp teachers /home/e-smith/files/users/$USER \
chmod g+r-w /home/e-smith/files/users/$USER \
chgrp teachers -R /home/e-smith/files/users/$USER/home \
chmod g+rw -R /home/e-smith/files/users/$USER/home \
chmod g+x /home/e-smith/files/users/$USER \
find /home/e-smith/files/users/$USER/home -type d -exec chmod g+s {};\
done
would it work? If so, then in the future just run the script against a mini user-list every time I add new users.
mweinber,
If I were setting up for the first time, then your suggestion to prefix user accounts is a really good idea.
steever,
your idea of groups like students and teachers is too generic. I need to go as far as g10it3 for the 3rd class of grade 10 IT pupils and g12cat1 for the 1st class of grade 12 cat pupils, etc. All grades have more than one group. These are then given access to certain ibays only.
Until you admin a school, it is very difficult to appreciate the granularity required in manipulating, on an ongoing basis, pupil user accounts in a large establishment.