Network Services
About network files
¬
In this topic	Network File System (NFS)
	File servers
	Clients
	Exported directories
	Imported directories
	The mount process
	File access
	Memory
	Disk space
		
¬
Summary	NEXTSTEP network filesharing is based on Network File System (NFS). You set up file servers to export directories. You set up clients to import these directories.

	You can set up a file server on any computer on the network.

	Clients can access the directories on one or more serversÐto read, create, or store files.

	When you set up a file server, you're supplying disk space and file access. You need to make sure you have enough disk space on the computer. You can control access by selecting the appropriate domain and enabling individual host computers with read/write or read-only permissions.	
	When you set up a client, you determine how the directories will be importedÐor mounted. They can be mounted when a host computer starts up or when a user first tries to open them.
	
	Information about file servers is stored in the /locations directory of the domain where you set up the file server. Information about clients is stored in the /mounts directory of the domain where you set up the file servers.

	CAUTION  Be sure you set up network time service for all servers and clients on the network. If computers on the network do not use the same time, it's possible that timestamps may conflict as users on various computers save files. 

¬
Network File System (NFS)

The Network File System (NFS) was originally developed by Sun as a way to share files and folders across the network. The NFS feature as it is shipped with NEXTSTEP uses the TCP protocol rather than the UDP protocol for greater reliability. 

¬File servers

A file server supplies disk spaceÐand a directory structureÐto users on a network. To these users, a directory on the file server seems just like directories on their local disks.

File servers can provide different types of service. They may be home directory servers that store the users' home directories. They may be application servers that provide a central location for applications. Or they may store data files organized by projects or organizational divisions.

When you set up a file server, you specify the directories it will export. You can specify that the file server provides services to all computers or to some particular computers. You can give those computers read-only, read/write, or root access.

You can set up a file server on any computer with a hard disk. You can use SimpleNetworkStarter ;../Reference/Tools/SimpleNetworkStarter/AboutSimpleNetworkStarter.rtfd;;¬ to set up a host to share filesystems for user home directories, applications, or general purpose (data). You can use NFS Manager to export any other directories you wish ;../Reference/Tools/NFSManager/AboutNFSManager.rtfd;;¬.

¬Clients
Clients import directories from a file server. You typically set up all computers on your network as NFS clients. Then users can log onto any computer on the network to access the files on the file server.

When you set up a client, you specify the directories it imports. It can import directories from several different file servers. You can give the client read-only or read/write access to each directory it imports.

You usually specify client access when you first add a computer to the network with SimpleNetworkStarter ;../Reference/Tools/SimpleNetworkStarter/AboutSimpleNetworkStarter.rtfd;;¬. You can then use NFSManager to import new directories at any time ;../Reference/Tools/NFSManager/AboutNFSManager.rtfd;;¬.

¬Exporting and importing

When a file server exports a directory, it exports the entire subdirectory structure below it. If you export the /Shared directory, you also export the /Shared/Projects directory (if such exists) .

You can't export both a directory and one of its subdirectories separately if they're on the same device. 

You can't export both the /Shared and /Shared/Projects as separate directories in this case. You can export the directories separately if they're stored on different partitions of the same drive.

You can only export directories from a local disk. You can't re-export a directory that has been imported from another disk.

¬Mount options

When a client imports directories, it mounts them. You specify the mount pointÐthat is, the place in the local directory structure where the remote directory appears.

For instance, the client mounts the remote directory /CustomsApps in the /CustomApps directory on the local disk.

You can give the mount point the same name as the directory name exported, or you can give the mount point a different name.

A client can mount all remote directories when the computer starts up. Or it can mount them automatically when the user opens the directory. Starting up automatically reduces network overhead because the directory isn't mounted unless the user actually needs it. Using automatic mounting also lets computers continue to work if a particular file server becomes unavailable.  

When you set up a client to mount automatically, the imported directory always appears in the /Net subdirectory on the local computer.

The pathname includes the host name for the local computer and the name of the exported directory.

When you use NFSManager to specify the mount point and automatic mounting, you can also specify the following mount options:

Foreground or	You can mount directories in the foreground or
Background	background. Unless you're mounting files automatically, 	background mounting is preferable. If a computer tries to 	mount a remote directory during startup and the directory 	isn't available for some reason, the computer will be 	able to complete the boot process if the mounting 	process can continue in the background.

Retry options	After a successful mount, a remote directory may become 	unavailable. The computer may be turned off or the 	network traffic may be too heavy. You can tell the client 	what to do in this case: 
¬	Retry until it successfully remounts the directory.
¬	Retry until the user presses Ctrl-c to interrupt.
¬	Return an error message.

setuid options	Some programs change the user id when they start up. For 	example, PrintManager changes the user ID to root (0) so 	that users can add new printers or remove print jobs from 	the print queue. Such programs are called setuid files, and 	they can present a security problem on the network. You 	can tell the client what to do when it encounters such a 	file:
¬	Run it under the owner specified in the file.
¬	Ignore the setuid bit and run it under the user who's currently logged in. This option is safer but may limit some of the functionality of the program.

Read Only or	You can control user access to directories at the client 
Read/Write	level. For example, you can specify read/write access for 	a group of computers when you export a directory. Or you 	can single out one or more of those computers to have 	read only access when they mount the system. The export 	permissions take precedence over the import permissions. 	
If you set these options in the root (/) domain, all other computers that you add as clients with SimpleNetworkStarter will use the the same options. If you want the options to apply to a single computer only, select the local domain when you set the options. Or select a midlevel domain to set the options for all the computers in that domain. 

You can change the mount options at any time.

¬File access
When you set up servers and clients, you can control access to files in three ways.

You choose the domain where you want to set up the file server. If you set it up in the root domain, all computers in the network can potentially access it. If you set it up in a midlevel domain, only the computers in that domain can access it.

You list the computers you want to have access to particular directories. When you export a directory, you can grant read/write access to one list of computers, read-only access to another, and root access to a third. If you grant root access to a computer, anyone who logs onto that computer with the root password has root privileges on the remote system. You can also specify read/write or read-only access for individual clients, as described above.

You can control user access by setting user and group permissions for individual files and folders. Unless you specify root access for a computer, users who log in as root typically are treated as unknown users when they access a remote system. Unknown users use the nobody account, which has a user ID of ±2. If you want unknown users to have a different user ID, you can set the ID when you export the directory.

You can use NFSManager to change export ;ChangeExportPermissions.rtfd;;¬ and import ;ChangeImportPermissions.rtfd;;¬ permissions. You can use the Inspector panel in FileManager to specify user and group permissions for individual files.

¬
Memory and disk space

Before you set up your servers, determine how much memory and hard disk space users are likely to need for each type of server. 

Home directory servers generally require the most memory and disk spaceÐor fewer users per server. As a rule, 25 to 40 MB of disk space per home directory is probably sufficient.

Other factors that increase the need for disk space and memory are the use of sound, color, or video, and the way users work with files. 

¬
Server information
 
Information about servers is stored as a set of property keys and values in the /locations directory of the domain where you set up the server:

Property key	Value
¬
name	the name of the computer 

_writers	an asterisk permits everyone with access to write. 
	If you list writers by name, you must list everyone 
	you want to have write access. 

customized_on	you can add notes to document your work. 
notes
	
You can examine file server information with NetInfoManager.

¬Client information
 
Information about clients is stored as a set of property keys and values in the /mounts directory of the domain where you set up the server:

Property key	Value
¬
name	the name of the directory exported 

dir	 the name of the directory imported 

opts	nfs options such as rw, ro, bg, timeo, and so on. 

You can examine client information with NetInfoManager.

¬

Related topics (click a ¬)
¬
Concepts
NEXTSTEP uses the NetInfo domain system for organizing user and file information. 
;../NetInfo/AboutNetInfo.rtfd;;¬	About NetInfo

NFSManager lets you set up computers to run NFS file sharing services. NFSManager also lets you fine-tune computers as NFS clients.
;../Reference/Tools/NFSManager/AboutNFSManager.rtfd;;¬	About NFSManager

File sharing is at the heart of networking planning and design. Be sure you plan carefully before you set up servers and clients. 
;../Setup/AboutSetup.rtfd;;¬	About setup

¬
How to
;ExportNewDirectory.rtfd;;¬	Export a new directory
;ImportNewDirectory.rtfd;;¬	Import a new directory
;MountDirectoryAutomatically.rtfd;;¬	Mount a directory automatically
;ChangeMountOptions.rtfd;;¬	Change mount options
;ChangeExportPermissions.rtfd;;¬	Change export permissions
;ChangeImportPermissions.rtfd;;¬	Change import permissions
;../NetInfo/ExamineFileServerInformation.rtfd;;¬	Examine file server information
;../NetInfo/ExamineClientInformation.rtfd;;¬	Examine client information