File Sharing Services

Mac OS X’s native file-sharing method is the Apple Filing Protocol ( AFP). As with related technologies such as SMB and NFS (see Section 10.4 in Chapter 10), it lets users of other computers (often, but not necessarily, other Macs) mount volumes of your local filesystem onto their own.

Both the command-line and GUI interfaces for administering AFP are very simple. To turn on AFP, activate the Personal File Sharing checkbox in the Sharing preference pane’s Services tab. This simply launches the AppleFileServer daemon (which resides in /usr/sbin). AppleFileServer takes no arguments; it makes all your machine’s volumes and User folders available for mounting on other computers, as described in Section 8.2.1 in Chapter 8. The program stores its configuration information (including the location of log files, whether it allows Guest access, and so on) in the /Library/Preferences/com.apple.AppleFileServer.plist file.

Toggling this checkbox in the Sharing pane also modifies the AFPSERVER line in /etc/hostconfig, read by the startup script /System/Library /StartupItems/AppleShare/AppleShare (see the next section).

The AFP server handles user authentication through Directory Services, in most cases referring to NetInfo for the list of volumes it’s allowed to provide to the requesting user. This list, of course, varies depending on the type of account that user has on the server.

Users with no accounts can log in as Guest and are allowed only to mount the Public directories ...

Get Mac OS X Panther in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.