Ch18 system administration


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Ch18 system administration

  1. 1. Network File Sharing Chapter 18
  2. 2. Chapter Goals <ul><li>Understand concepts of network file sharing </li></ul><ul><li>Understand NFS server setup </li></ul><ul><li>Understand NFS client setup </li></ul><ul><li>Understand NFS security </li></ul><ul><li>Understand NFS mount options </li></ul><ul><li>Understand differences and similarities between AFS and NFS </li></ul><ul><li>Understand basics of Microsoft File Sharing </li></ul>
  3. 3. Network File Sharing <ul><li>File servers make files available to other hosts on the network. </li></ul><ul><li>File service clients obtain file systems from file servers. </li></ul><ul><li>File service peers are (both) servers and clients. </li></ul><ul><li>Network file sharing employs Remote Procedure Calls (RPC’s). </li></ul>
  4. 4. Network File Sharing <ul><li>Network File Systems allow the users files to “migrate” from workstation to workstation with them. </li></ul><ul><li>Network File Systems simplify life for the user, but generally make system administration more complicated (due to the setup costs). </li></ul><ul><li>In Lab 6 we will setup the Sun Network File System (NFS) services on the lab machines. </li></ul><ul><li>NFS has two components: The server side software, and the client side software. Each component is actually a suite of programs which implement the sockets required to provide network based filesystems. </li></ul><ul><li>NFS is stateless. </li></ul>
  5. 5. Network File Sharing <ul><li>Server side: </li></ul><ul><ul><li>Rpcbind (portmap) </li></ul></ul><ul><ul><li>Mountd - respond to mount requests (sometimes called rpc.mountd ). </li></ul></ul><ul><ul><ul><li>Relies on several files </li></ul></ul></ul><ul><ul><ul><ul><li>/etc/dfs/dfstab, </li></ul></ul></ul></ul><ul><ul><ul><ul><li>/etc/exports, </li></ul></ul></ul></ul><ul><ul><ul><ul><li>/etc/netgroup </li></ul></ul></ul></ul><ul><ul><li>nfsd - serves files - actually a call to kernel level code. </li></ul></ul><ul><ul><li>lockd – file locking daemon. </li></ul></ul><ul><ul><li>statd – manages locks for lockd. </li></ul></ul><ul><ul><li>rquotad – manages quotas for exported file systems. </li></ul></ul>
  6. 6. Network File Sharing <ul><li>Client Side </li></ul><ul><ul><li>biod - client side caching daemon </li></ul></ul><ul><ul><li>mount must understand the hostname:directory convention. </li></ul></ul><ul><ul><li>Filesystem entries in /etc/[v]fstab tell the client what filesystems to mount. </li></ul></ul>
  7. 7. Network File Sharing
  8. 8. Network File Sharing
  9. 9. Network File Sharing <ul><li>The mount command has several extensions for use with NFS. Mount has to understand timeouts, soft mounts, background mounts, and the automounter. </li></ul><ul><ul><li>rw/ro - Read/write and read only. NFS file systems that are mounted read/write can block activity on the client when the server providing the file system becomes unavailable. See intr and bg below. </li></ul></ul><ul><ul><li>hard/soft - The hard option mounts an NFS file system in such a way as to ensure that data is written to the remote file system. If the file server becomes unavailable, a file system mounted with the hard option will stop all remote file operations until the file server becomes available again. All file systems mounted with the rw option should also use the hard option to ensure the integrity of data written to the file system. The soft option does not provide assurance of data writes to the remote file system, but does not stop remote file operations in the case of a file server becoming unavailable. This option is useful for file systems that are mounted read-only. </li></ul></ul>
  10. 10. Network File Sharing <ul><ul><li>suid/nosuid - The nosuid option negates the effect of programs on the remote file system for which respective setuid bits are set. Setuid programs run from NFS file systems mounted with the nosuid option are executed with the normal permissions of the user executing the program, not those conferred by the setuid bit. This option is used to increase the security of the client by preventing setuid programs on remote file systems from being used on the client system. </li></ul></ul><ul><ul><li>bg/fg - This option pair controls how to handle a failed mount of an NFS file system. Mounts with the bg option are retried in the background, freeing the shell which issued the mount command. Use this option when mounting file systems in /etc/vfstab or /etc/fstab to prevent a workstation from stopping during the boot sequence because a file server is down. </li></ul></ul><ul><ul><li>intr/nointr - The nointr option prevents program interrupts when programs cause an NFS operation to occur. This can result in programs being uninterruptible when an NFS file server becomes unavailable. The default is to allow interrupts so that programs can be aborted in the event of server failures. </li></ul></ul>
  11. 11. Network File Sharing <ul><ul><li>retry=n - Number of times to retry a failed mount. The default of 10,000 is usually sufficient. </li></ul></ul><ul><ul><li>timeo=n - Time-out value for retrying NFS operations. Increase this value to permit very slow systems, such as near-line file stores, more time to complete basic operations. </li></ul></ul><ul><ul><li>retrans=n - Number of retransmissions of a given NFS operation. The setting depends on the network and type of server being used. Some networks where packet loss is high benefit from an increase in the number of retransmissions. </li></ul></ul><ul><ul><li>rsize=n - Read buffer size. Some servers and clients (e.g., those with slower or less reliable network connections) perform better when the buffer used for NFS operations is a different size than the default. </li></ul></ul><ul><ul><li>wsize=n - Write buffer size. Similar to rsize in usage. </li></ul></ul>
  12. 12. Network File Sharing <ul><ul><li>proto=? - Controls the network protocol used to transport NFS data. NFS uses IP datagrams by default. By setting proto=tcp, NFS will use tcp, thereby improving performance when moving data over wide area networks and the Internet. </li></ul></ul><ul><ul><li>secure - On Solaris 7 and early versionsof NFS this option enables NIS+ public key cryptography to be used for NFS authentication and encrypted communications. This option has been deprecated in favor of the “sec=?” option below. </li></ul></ul><ul><ul><li>sec=? - New in Solaris 8. This option replaces the “secure” option of previous versions. It controls the security mode used for NFS. Options are “sys” for UID & GID based control, “dh” (Diffie-Hellman) for NIS+ based public key cryptography, “kerb4” for MIT Kerberos authentication and “none” which provides no authentication and maps all accesses to “nobody” as described below. </li></ul></ul>
  13. 13. Network File Sharing <ul><ul><li>quota/noquota - Setting this option enables disk quota checking via the rquota service. The rquotad daemon must be running on the server for this to function. Noquota is the default. </li></ul></ul><ul><ul><li>remount - This option is often used when mounting a file system manually. It converts a mount point from read-only to read-write status. </li></ul></ul><ul><ul><li>vers=n - NFS protocol version number (2 or 3). By default, the mount command will attempt to use the highest version number protocol available from the server. This option allows the protocol version to be fixed for use with servers that support only the older version 2 protocol. </li></ul></ul>
  14. 14. Network File Sharing <ul><ul><li>NFS is NOT secure . </li></ul></ul><ul><ul><ul><li>Keep /etc/dfs, /etc/exports locked up (root readable), </li></ul></ul></ul><ul><ul><ul><li>Use Fully Qualified Domain Names for hosts (FQDN). </li></ul></ul></ul><ul><ul><ul><li>Make sure you implement any security patches for NFS. </li></ul></ul></ul><ul><ul><ul><li>Make sure you get rid of “+” in any automount map files! </li></ul></ul></ul><ul><li>Monitoring NFS </li></ul><ul><ul><li>The nfsstat command can be used to look at the NFS performance statistics. The -s flag looks at server statistics, and the -c flag looks at client side statistics. </li></ul></ul>
  15. 15. Network File Sharing <ul><li>Windows uses a different approach to file sharing. </li></ul><ul><ul><li>Server Message Block (SMB) is a proprietary protocol that was developed to support Windows networking. </li></ul></ul><ul><ul><ul><li>Port 135 </li></ul></ul></ul><ul><ul><ul><li>Port 136 </li></ul></ul></ul><ul><ul><ul><li>Port 137 – the NetBios Name Service </li></ul></ul></ul><ul><ul><ul><li>Port 138 </li></ul></ul></ul><ul><ul><ul><li>Port 139 – The NetBios Session Service </li></ul></ul></ul><ul><ul><li>Now that Microsoft has embraced TCP/IP networking, Windows is converting to a new protocol: Common Internet File System (CIFS). </li></ul></ul>
  16. 16. Network File Sharing <ul><li>Permissions </li></ul><ul><ul><li>Under NFS, and AFS, the user (or administrator) can assign access permissions to directories, and to the files within those directories. </li></ul></ul><ul><ul><li>Under Windows, the permissions cover the directory. Files within a directory inherit the permissions of the directory. </li></ul></ul><ul><ul><li>Shared folder permissions only apply to the folder when it is accessed via the network. The local permissions pertain when accessing files locally on the server. </li></ul></ul><ul><ul><li>The default permission under Windows is “Everyone: Full Control” ! </li></ul></ul><ul><ul><ul><li>This means that everyone has access to all files in the shared folder. </li></ul></ul></ul>
  17. 17. Network File Sharing <ul><li>Group Permissions </li></ul><ul><ul><li>Domain </li></ul></ul><ul><ul><ul><li>Administrator and Server Operator groups can share folders on any host in the domain. </li></ul></ul></ul><ul><ul><ul><li>Power Users can share folders on a single host. </li></ul></ul></ul><ul><ul><li>Workgroup </li></ul></ul><ul><ul><ul><li>Administrators and Power Users can share folders. </li></ul></ul></ul><ul><ul><li>Users with the Create Permanent Shared Objects permission can create shares. </li></ul></ul>
  18. 18. Network File Sharing <ul><li>Some folders are shared automatically: </li></ul><ul><ul><li>The share name has a “$” appended to the end. </li></ul></ul><ul><ul><li>These shares are “hidden” shares. </li></ul></ul><ul><ul><li>Automatically shared folders include: </li></ul></ul><ul><ul><ul><li>The root of each volume (C$ D$ E$ …) </li></ul></ul></ul><ul><ul><ul><li>The system root folder (Admin$) </li></ul></ul></ul><ul><ul><ul><li>The location of the printer drivers (Print$) </li></ul></ul></ul>
  19. 19. Network File Sharing <ul><li>Sharing setup </li></ul><ul><ul><li>Right click the folder </li></ul></ul><ul><ul><li>Select Sharing </li></ul></ul><ul><ul><li>Fill in the forms </li></ul></ul><ul><ul><li>Network File Sharing is much easier to set up than NFS/AFS. </li></ul></ul><ul><ul><li>Network File Sharing is much less secure than NFS/AFS. </li></ul></ul>
  20. 20. Network File Sharing <ul><li>SAMBA is an SMB/CIFS file sharing daemon that runs on UNIX hosts. </li></ul><ul><ul><li>Clients make SMB requests on the network </li></ul></ul><ul><ul><li>Samba accepts SMB file requests from clients and uses UNIX calls to obtain requested file from disks. </li></ul></ul><ul><ul><li>Samba returns SMB file information to the client. </li></ul></ul><ul><ul><li>SAMBA is free. </li></ul></ul><ul><ul><li>TotalNet is another solution which performs the same function. </li></ul></ul><ul><ul><ul><li>TotalNet is a commercial product. </li></ul></ul></ul><ul><ul><li>“ Dave” performs the same function for MacOS. (Free) </li></ul></ul><ul><ul><ul><li>Xinet is a commercial product that performs the same function. </li></ul></ul></ul>
  21. 21. Network File Sharing <ul><ul><li>A common goal for an organization is to provide one file farm which is accessible from all platforms. </li></ul></ul><ul><ul><ul><li>At Notre Dame we use AFS – it is native to the UNIX environment, but it works for Windows/MacOS. </li></ul></ul></ul><ul><ul><ul><ul><li>The MacOS and Windows AFS access may be via an AFS to NFS translator box. </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>The client machines run NFS. </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>The clients make NFS requests to a translator. </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>The translator makes AFS requests to the fileserver. </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><li>NT is supported as a native AFS client. NT does not require AFS translators. </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>NT port uses a memory based filesystem cache </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>NT port is not very robust. </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>OpenAFS is much better than TransArc’s NT client. </li></ul></ul></ul></ul></ul>
  22. 22. Network File Sharing <ul><li>Athena File System (AFS) </li></ul><ul><ul><li>AFS came from the CMU Athena File System. </li></ul></ul><ul><ul><li>AFS is now distributed as a commercial product by TransARC Corporation (part of IBM). </li></ul></ul><ul><ul><li>OpenAFS is an open source version of AFS built from TransARC source code. </li></ul></ul><ul><ul><li>ARLA is another open source AFS built from independent code. </li></ul></ul><ul><ul><li>AFS appears most often at Universities. </li></ul></ul><ul><ul><li>AFS was supposed to be a precursor to DFS (Distributed File System). </li></ul></ul><ul><ul><li>AFS and NFS do the same things, so why chose one over the other? </li></ul></ul>
  23. 23. Network File Sharing <ul><li>NFS </li></ul><ul><ul><li>Distributed with OS </li></ul></ul><ul><ul><li>client side cache is optional </li></ul></ul><ul><ul><li>clear-text passwords on net </li></ul></ul><ul><ul><li>Does not scale well </li></ul></ul><ul><ul><li>Uses standard UNIX permissions </li></ul></ul><ul><ul><li>Not secure </li></ul></ul><ul><ul><li>More reliable than AFS (?) </li></ul></ul><ul><li>AFS </li></ul><ul><ul><li>Add-in product </li></ul></ul><ul><ul><li>client side caching is standard </li></ul></ul><ul><ul><li>authenticated challenge on net </li></ul></ul><ul><ul><li>scales well </li></ul></ul><ul><ul><li>Uses Access Control Lists (ACL’s) </li></ul></ul><ul><ul><li>More secure than NFS </li></ul></ul><ul><ul><li>Less reliable than NFS (?) </li></ul></ul>
  24. 24. Network File Sharing <ul><li>NFS </li></ul><ul><ul><li>Low administrative overhead </li></ul></ul><ul><ul><li>Standard UNIX backup /restore </li></ul></ul><ul><ul><li>Available for most OS </li></ul></ul><ul><ul><li>Distributed administration </li></ul></ul><ul><ul><li>Uses standard utilities </li></ul></ul><ul><li>AFS </li></ul><ul><ul><li>High administrative overhead </li></ul></ul><ul><ul><li>“ Enhanced” backup /restore </li></ul></ul><ul><ul><li>Limited OS availability </li></ul></ul><ul><ul><li>Central administration </li></ul></ul><ul><ul><li>replaces standard utilities </li></ul></ul>
  25. 25. Network File Sharing <ul><li>AFS </li></ul><ul><ul><li>AFS replaces many system library calls with custom versions: </li></ul></ul><ul><ul><ul><li>passwords - are stored in a common (AFS) file. </li></ul></ul></ul><ul><ul><ul><li>ftp, telnet, rlogin, rsh have to be modified to use the new password utility. (NO LONGER TRUE as of Solaris 2.6 when using PAM) </li></ul></ul></ul><ul><ul><ul><li>root’s password is held locally in the normal location, so root is not an authenticated AFS user. </li></ul></ul></ul><ul><ul><ul><li>The filesystem code is altered such that the local cache disk is checked for files before going to the network. </li></ul></ul></ul>
  26. 26. Network File Sharing <ul><li>AFS </li></ul><ul><ul><li>AFS improves system security due to the way it authenticates the users: </li></ul></ul><ul><ul><ul><li>The UID of the user is ignored by the filesystem. The filesystem relies on an authentication token instead. </li></ul></ul></ul><ul><ul><ul><li>NFS uses the user id to authenticate file access. The UID can be changed by a crafty user. </li></ul></ul></ul><ul><ul><ul><li>On standard UFS filesystems, root can read/write every file. NFS can also allow root read/write. </li></ul></ul></ul><ul><ul><ul><li>Under AFS, root does not have the ability to go read other users (AFS based) files. </li></ul></ul></ul>
  27. 27. Network File Sharing <ul><li>AFS </li></ul><ul><ul><li>When you install AFS, the installation procedure creates some new directories: </li></ul></ul><ul><ul><li>/usr/afsws - contains the binaries for the AFS suite: fs, tokens, pts </li></ul></ul><ul><ul><li>/usr/vice - contains the AFS administrative files: </li></ul></ul><ul><ul><ul><li>cache files (/usr/vice/cache) </li></ul></ul></ul><ul><ul><ul><li>administrative information about this AFS client (/usr/vice/etc). </li></ul></ul></ul><ul><ul><li>The package software is also installed. Package is a utility for updating system files upon reboot. </li></ul></ul>
  28. 28. Network File Sharing <ul><li>AFS </li></ul><ul><ul><ul><li>Once all of the binaries are in place, the afs software creates a cache directory and initializes a series of files in this directory. </li></ul></ul></ul><ul><ul><ul><li>When the cache scan is complete, the system reboots so that AFS will start up on the system. </li></ul></ul></ul><ul><ul><ul><li>At reboot, the package utility looks for a configuration file which tells which files to sync to the master repository. </li></ul></ul></ul><ul><ul><ul><ul><li>This architecture dependent file tells package which files need to be updated, what modes to make things, which entries are regular files, which entries should force a reboot if they get updated, etc. </li></ul></ul></ul></ul>
  29. 29. Network File Sharing <ul><li>AFS </li></ul><ul><ul><ul><li>Once the package command has updated all of the files it looks to see if any of the updated files had the “reboot” flag set. If so, the system reboots again. </li></ul></ul></ul><ul><ul><ul><li>This time, the system files should all be up to date. </li></ul></ul></ul><ul><ul><ul><li>Departments can even use their own package run (controlled by /.package_dept) which updates specific files (sendmail, password files, message of the day, hosts files, Mentor Graphics links). </li></ul></ul></ul><ul><ul><ul><ul><li>If any of these files have the “reboot” flag set, the system reboots again. </li></ul></ul></ul></ul>
  30. 30. Summary <ul><li>Network File Sharing relies on Remote Procedure Calls. </li></ul><ul><li>Network File Sharing is convenient for users. </li></ul><ul><li>Network File sharing requires setup by the sysadmin. </li></ul><ul><li>Network file sharing opens the door to many security problems. </li></ul>