To Previous Chapter To Table of Contents To Bottom of Page To Next Chapter

Chapter 12 - NFS and NIS

  1. Network File System (NFS) - developed by Sun Microsystems
    used to integrate workstations into LANs and simplify remote file access and peripheral sharing by logically attaching (mounting) the NFS server's file system to the client

  2. NFS Protocols
    NFS, MOUNT, YP, YPBIND, NLM, REX
    XDR
    RPC
    TCP/UDP
    IP
    Ethernet
    • Remote Procedure Call (RPC) - session layer
      • service - group of procedures (limited to one service per server)
      • program number - identifier for each service
      • client sends an RPC Request to the Server
      • server responds with an RPC Reply
      • can use either TCP or UDP
      RPC Protocol Header
      Transaction ID Number
      Send Direction Indicator
      Version Number
      Program Number
      Version Number
      Procedure Number
      Authentication Information (400 bytes max)
      Authentication Verification (400 bytes max)
      Procedure Call Parameters

      Types of authentication:

      • none
      • UNIX permissions (group and user IDs); used by the NFS protocol
      • short - client generates an authentication sequence
      • DES (Data Encryption Standard)

      services are recorded in /etc/rpc
      connections are managed by a port mapper
    • External Data Representation (XDR) - method used to encode data within an RPC message; uses sequential bits written into abuffer, formatted into a mssage and then sent to the lower protocol layers
    • Network File System Protocol - method of communicating information about a procedure to be run
      • composed of a set of RFC procedures
      • stateless protocol
      • NFS defines a set of protocol constants used to establish parameters [# of bytes in a pathname; max. # of bytes read/written, size of NFS pointer]
      • uses file handles - 32-byte filed of free format used to identify the file on the server
      • uses same file types as UNIX
      • NFS protocol includes 17 procedures [Table 12.1]
    • Mount Protocol returns a file handle from the server to the client enabling the client to access an area on the server file system [performed by the mountd on both the client and server]
    • File Locking - needed during maintenance, software updates, and to protect data [not part of original NFS]
    • Remote Execution Service (REX) - enables users to run commands on another machine with full environmental variables [uses rexd]
    • rusers and spray
      • rusers (gives list of remote users logged on]
      • spray - similar to ping

  3. Configuring NFS
    • Configuring UNIX as an NFS Server
      • check if RPC is active: rpcinfo -p
      • NFS is stated/stopped using the script /etc/nfs (either automatically by linking to /etc/rc2.d/Sname or manually using /etc/nfs start
      • available filesystems must be listed in /etc/exports on SCO UNIX
      • Some versions of UNIX use the share command
    • Setting Up a UNIX NFS Client
      mount -F nfs -o options machine:filesystem mount-point
    • Setting Up Windows-Based NFS - uses ChameleonNFS
    • Sharing a Windows Directory

  4. Network Information Service (NIS) [previously named YP]
    • developed to enable one single, central user file holding passwords to be shared over the network
    • uses the RPC authentication procedures
    • requires an NIS master or ypmaster and possibly slaves or ypslaves and uses domains
    • NIS keeps access information in a set of maps (for each part of the domain]
    • NIS can also be used to keep other files like /etc/hosts

  5. Configuring NIS - typically handles files:
    1. /etc/ethers (Ethernet MAC to IP address mappings)
    2. /etc/groups [Group access information
    3. /etc/hosts [IP address to hostname mappings]
    4. /etc/netmasks [IP network masks]
    5. /etc/passwd [User access information]
    6. /etc/protocols [Network protocols and number mappings]
    7. /etc/rpc [RPC numbers]
    8. /etc/services [Port number to TCP/IP protocol mappings]
    • Setting Up the NIS Domain
      1. decide on a domain name & IP addresses of the NIS master and any NIS slaves
      2. log into each client and set up the domain name: domainname domain or enter this command into the rc command: /etc/rc.d
    • NIS Daemons - ypservfor master and slaves; ypbind for clients
    • Setting Up an NIS Master
      1. verify /etc/passwd and /etc/group on NIS Master (make sure all accounts have passwords or are disabled)
      2. generate NIS maps: /usr/sbin/ypinit -m [produces maps for each file named in /var/yp]
      3. add following code to the rc file that starts RPC:
        	if [ -f /etc/yp/ypserv -a -d /var/yp/'domainname' ] then
        		/etc/yp/ypserv
        	fi
        
      4. add the following code to start ypbind so that ypserv can find the maps:
        	if [ -d /var/yp ] then
        		/etc/yp/ypbind
        	fi
        
      5. test with
        ypmatch wsummers passwd

    • Setting Up NIS Slaves
      1. check the startup rc commands to ensure that the domainname variable has been set
      2. set up the NIS slave and propagate the NIS files: /etc/yp/ypbind [check with the ypwhich command]
      3. run /etc/yp/ypinit -s servername [test with the ypmatch command]
      4. can create a series of cron entries to update the maps: ypxfer passwd.byname
    • Setting Up NIS Clients
      1. check the startup rc commands to ensure that the domainname variable has been set
      2. mount the NIS files: /etc/yp/ypbind [check with the ypwhich command]
      3. add +:*:):)::: to the bottom of the /etc/passwd local file to instruct the ypbind to query the NIS master

  6. RPC and NFS Administration
    • rpcinfo - monitors the port mapper of the machine on which it is running, and through the network, the port mappers of servers. [displays the contnets of the mapping tables]
    • nfsstat - provides statistics about the number and type of RPC requares that are made

To Previous Chapter To Table of Contents To top of page To Next Chapter