5.3 Shell Script - Creating User Groups |
|
|
Grouping users together allows you to organise user files and restrict user access logically - and so simplifies some administrative procedures. The following describes using a shell script to create user groups and group folders. |
|
| Log in as "root" to the server that hosts the NetInfo master. | |
| Copy the script "mkgroups.sh" into roots' home directory (/private/var/root/Documents). | |
| Start a new shell. | |
|
Change directory to roots' home directory, type:
|
|
|
Make sure that the execute flag is set on the script "mkusers.sh" by typing:
|
|
| Launch a text editor. | |
|
The "TextEdit" application defaults to "RTF" for new files. To change the defaults to plain text, select "Preferences..." from the "TextEdit" menu. |
|
| Click on the "Plain text" radio button, then close down preferences. | |
| Create a new file. | |
|
Create a new text file containing a line for every group that gives the following information:
|
|
| Save the file as "groups.txt" in roots' home directory. | |
| Quit the editor. | |
|
Execute the "mkgroups.sh" script and pass it the file "groups.txt" as a parameter by typing the following:
The script will create Mac OS X netinfo group entries for every group specified in the file. |
|
|
Now that the groups are defined, we need to make sure that all the folders required by the groups are available. Copy the script "mkgroupfldrs.sh" into roots' home directory (/private/var/root/Documents). |
|
|
Execute the "mkgroupfldrs.sh" script by typing the following:
This script will create the group folder and any required subfolders for every group whose SharePoint (as specified in the text file) is local to this server. For this reason, the "mkgroupfldrs.sh" script should be run on every server that hosts shares or groups. |
|
![]() |
|
|
The script creates a folder within the share folder with the groups
name, ie: The script also creates the following (Macintosh Manager) folders within
the share folder: | |
| Mac OSX server - tech notes - © 2002 by Mark J Swift - msw AT blackpool.ac.uk | |