3.1 Shell Script - Quickly creating shares, groups, users & homes

This section describes using a shell script and some text files to quickly set up mounts, SharePoints, groups, user accounts and home directories. The script also automatically sets up Netscape OS 9 prefs for every user.

The following shows in detail how to quickly set up the server for access from OS X and OS 9 clients.

Log in as "root" to the server that hosts the NetInfo master.  

Copy the following scripts into roots' home directory (/private/var/root/Documents):

mkall.sh
mkmounts.sh
mkshares.sh
mksharefldrs.sh
mkgroups.sh
mkgroupfldrs.sh
mkusers.sh
mkuserfldrs.sh
mknetscaperegs.sh
lsgroups.sh

 
Start a new shell.  

Change directory to roots' home directory, type:

cd ~/Documents

 

Make sure that the execute flag is set on the script "mkusers.sh" by typing:

chmod u+x mkall.sh

 
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 text file containing a line for every mount that gives the following information:

machine_name,machine_ip,share_path

Save the file as "mounts.txt" in roots' home directory.

 

Create a new text file containing a line for every group that gives the following information:

group_realname,group_shortname,owner,
host_name,share_point

Save the file as "groups.txt" in roots' home directory.

 

Create a text file containing a line for every user that gives the following information:

user_shortname,user_realname,password,
group

Save the file as "users.txt" in roots' home directory.

Note, there is a second format for the text file as follows:

user_shortname,user_realname,group

If you create a text file in this format, the password is taken to be the same as the users short name.

 
Quit the editor.  

Execute the "mkall.sh" script as follows:

~/Documents/mkall.sh

You should run these scripts on every machine that hosts user directories.

 

The script will create mounts, shares, groups, users and all the folders required for OS X clients to log in.

Before an OS 9 user can log in, user details must be imported into Macintosh Manager.

When the script above completes, a file will be created in roots' home directory (/private/var/root/Documents) called "mmgroups.txt".

This file contains a list of users and their group memberships. This is useful for assigning users to Workgroups within the Macintosh Manager application.

Macintosh Manager controls log-ins from Mac OS 9 clients. It also allows administrators to assign local file system rights to MM users & MM workgroups.

Launch "Macintosh Manager.app".

 
Enter the administrators name and password into the authentication box.  
Click on "Users" tab, and then click on the "Import all" button.  

User names will be imported from the server.

 

Before the imported users can log in, they must be assigned to a Workgroup.

Select "Import User List..." from the "File" menu.

 
Select the workgroup users text file and click the "Import" button.  

Click on "Name #1" in the "Available Fields" list, then click on the "Add >" button. "Name #1" should appear in the "Import" list.

Next, click on "WorkGroup" in the "Available Fields" list, then click on the "Add >" button. "WorkGroup" should appear in the "Import" list.

 

Click on "Open Sample Import..." button to check the import.

A sample import will be displayed.

 

Click the "OK" button to close this sample screen.

 

If you are not happy with the sample import click the "Cancel" button.

...Otherwise, click the "OK" button to begin importing the WorkGroup info.

 

Once users have been assigned to workgroups, you need to set the Macintosh Manager options.

This depends on your own individual situation - but here are a few suggestions...

 

Ticking "Members can open any items on local volumes" allows users to run every application that is installed on a machine's local hard drive.

Giving r/w on"Removable media (except CDs)" allows users to save to Zip disks and other removable media

Giving r/w to a "Folder on start-up disk named" "Documents" fixes a problem with some versions of Microsoft Office. This problem shows up when "Save As" fails to show a save dialog.

Storing the "Group Documents" on the same share point as user homes, cuts down on the number of SharePoints that are mounted on the user's desktop.

Also, if you have more than one server - workload is more evenly distributed since one server is not bogged down serving group files for every user on the network.

"Always try auto log-in with user's name and password first" makes sure that users connect to your server with their own name, rather than as a generic "Macintosh Manager User".

Ticking "Copy preferences when workgroup members log in" allows you to control application preferences.

Allowing users to change their own password is probably a good idea.

Copying only internet or administer-defined preferences prevents big delays at log-in and log-out if "Copy preferences" is enabled and the preference folder is very big (which it usually is).

Putting the user's email info in the internet preferences is very convenient if you are running mail apps.

Setting disk quotas is essential to prevent users from wasting disk space.

 

Synchronising computer clocks with the server is essential. I suspect that some server slow downs are due to date stamp problems.

Setting the default email server is necessary if user email info is being put into the internet preferences.

 

That's all folks!...

 
Mac OSX server - tech notes - © 2002 by Mark J Swift - msw AT blackpool.ac.uk