git: 2016893e14 - main - Remove accidentally commited .orig file

From: Gordon Bergling <gbe_at_FreeBSD.org>
Date: Fri, 17 Nov 2023 19:27:59 UTC
The branch main has been updated by gbe:

URL: https://cgit.FreeBSD.org/doc/commit/?id=2016893e14e43b4f14e1c279f4de7b7c43d27cca

commit 2016893e14e43b4f14e1c279f4de7b7c43d27cca
Author:     Gordon Bergling <gbe@FreeBSD.org>
AuthorDate: 2023-11-17 19:27:09 +0000
Commit:     Gordon Bergling <gbe@FreeBSD.org>
CommitDate: 2023-11-17 19:27:09 +0000

    Remove accidentally commited .orig file
    
    PR:     241673
---
 .../handbook/network-servers/_index.adoc.orig      | 3016 --------------------
 1 file changed, 3016 deletions(-)

diff --git a/documentation/content/en/books/handbook/network-servers/_index.adoc.orig b/documentation/content/en/books/handbook/network-servers/_index.adoc.orig
deleted file mode 100644
index 293a5cf281..0000000000
--- a/documentation/content/en/books/handbook/network-servers/_index.adoc.orig
+++ /dev/null
@@ -1,3016 +0,0 @@
----
-title: Chapter 32. Network Servers
-part: IV. Network Communication
-prev: books/handbook/mail
-next: books/handbook/firewalls
-description: This chapter covers some of the more frequently used network services on UNIX systems
-tags: ["network", "servers", "inetd", "NFS", "NIS", "LDAP", "DHCP", "DNS", "Apache HTTP", "FTP", "Samba", "NTP", "iSCSI"]
-showBookMenu: true
-weight: 37
-path: "/books/handbook/"
----
-
-[[network-servers]]
-= Network Servers
-:doctype: book
-:toc: macro
-:toclevels: 1
-:icons: font
-:sectnums:
-:sectnumlevels: 6
-:sectnumoffset: 32
-:partnums:
-:source-highlighter: rouge
-:experimental:
-:images-path: books/handbook/network-servers/
-
-ifdef::env-beastie[]
-ifdef::backend-html5[]
-:imagesdir: ../../../../images/{images-path}
-endif::[]
-ifndef::book[]
-include::shared/authors.adoc[]
-include::shared/mirrors.adoc[]
-include::shared/releases.adoc[]
-include::shared/attributes/attributes-{{% lang %}}.adoc[]
-include::shared/{{% lang %}}/teams.adoc[]
-include::shared/{{% lang %}}/mailing-lists.adoc[]
-include::shared/{{% lang %}}/urls.adoc[]
-toc::[]
-endif::[]
-ifdef::backend-pdf,backend-epub3[]
-include::../../../../../shared/asciidoctor.adoc[]
-endif::[]
-endif::[]
-
-ifndef::env-beastie[]
-toc::[]
-include::../../../../../shared/asciidoctor.adoc[]
-endif::[]
-
-[[network-servers-synopsis]]
-== Synopsis
-
-This chapter covers some of the more frequently used network services on UNIX(R) systems.
-This includes installing, configuring, testing, and maintaining many different types of network services.
-Example configuration files are included throughout this chapter for reference.
-
-By the end of this chapter, readers will know:
-
-* How to manage the inetd daemon.
-* How to set up the Network File System (NFS).
-* How to set up the Network Information Server (NIS) for centralizing and sharing user accounts.
-* How to set FreeBSD up to act as an LDAP server or client
-* How to set up automatic network settings using DHCP.
-* How to set up a Domain Name Server (DNS).
-* How to set up the Apache HTTP Server.
-* How to set up a File Transfer Protocol (FTP) server.
-* How to set up a file and print server for Windows(R) clients using Samba.
-* How to synchronize the time and date, and set up a time server using the Network Time Protocol (NTP).
-* How to set up iSCSI.
-
-This chapter assumes a basic knowledge of:
-
-* [.filename]#/etc/rc# scripts.
-* Network terminology.
-* Installation of additional third-party software (crossref:ports[ports,Installing Applications: Packages and Ports]).
-
-[[network-inetd]]
-== The inetd Super-Server
-
-The man:inetd[8] daemon is sometimes referred to as a Super-Server because it manages connections for many services.
-Instead of starting multiple applications, only the inetd service needs to be started.
-When a connection is received for a service that is managed by inetd, it determines which program the connection is destined for, spawns a process for that program, and delegates the program a socket.
-Using inetd for services that are not heavily used can reduce system load, when compared to running each daemon individually in stand-alone mode.
-
-Primarily, inetd is used to spawn other daemons, but several trivial protocols are handled internally, such as chargen, auth, time, echo, discard, and daytime.
-
-This section covers the basics of configuring inetd.
-
-[[network-inetd-conf]]
-=== Configuration File
-
-Configuration of inetd is done by editing [.filename]#/etc/inetd.conf#.
-Each line of this configuration file represents an application which can be started by inetd.
-By default, every line starts with a comment (`+#+`), meaning that inetd is not listening for any applications.
-To configure inetd to listen for an application's connections, remove the `+#+` at the beginning of the line for that application.
-
-After saving your edits, configure inetd to start at system boot by editing [.filename]#/etc/rc.conf#:
-
-[.programlisting]
-....
-inetd_enable="YES"
-....
-
-To start inetd now, so that it listens for the service you configured, type:
-
-[source,shell]
-....
-# service inetd start
-....
-
-Once inetd is started, it needs to be notified whenever a modification is made to [.filename]#/etc/inetd.conf#:
-
-[[network-inetd-reread]]
-.Reloading the inetd Configuration File
-[example]
-====
-
-[source,shell]
-....
-# service inetd reload
-....
-
-====
-
-Typically, the default entry for an application does not need to be edited beyond removing the `+#+`.
-In some situations, it may be appropriate to edit the default entry.
-
-As an example, this is the default entry for man:ftpd[8] over IPv4:
-
-[.programlisting]
-....
-ftp     stream  tcp     nowait  root    /usr/libexec/ftpd       ftpd -l
-....
-
-The seven columns in an entry are as follows:
-
-[.programlisting]
-....
-service-name
-socket-type
-protocol
-{wait|nowait}[/max-child[/max-connections-per-ip-per-minute[/max-child-per-ip]]]
-user[:group][/login-class]
-server-program
-server-program-arguments
-....
-
-where:
-
-service-name::
-The service name of the daemon to start.
-It must correspond to a service listed in [.filename]#/etc/services#.
-This determines which port inetd listens on for incoming connections to that service.
-When using a custom service, it must first be added to [.filename]#/etc/services#.
-
-socket-type::
-Either `stream`, `dgram`, `raw`, or `seqpacket`.
-Use `stream` for TCP connections and `dgram` for UDP services.
-
-protocol::
-Use one of the following protocol names:
-+
-[.informaltable]
-[cols="1,1", frame="none", options="header"]
-|===
-| Protocol Name
-| Explanation
-
-
-|tcp or tcp4
-|TCP IPv4
-
-|udp or udp4
-|UDP IPv4
-
-|tcp6
-|TCP IPv6
-
-|udp6
-|UDP IPv6
-
-|tcp46
-|Both TCP IPv4 and IPv6
-
-|udp46
-|Both UDP IPv4 and IPv6
-|===
-
-{wait|nowait}[/max-child[/max-connections-per-ip-per-minute[/max-child-per-ip]]]::
-In this field, `wait` or `nowait` must be specified.
-`max-child`, `max-connections-per-ip-per-minute` and `max-child-per-ip` are optional.
-+
-`wait|nowait` indicates whether or not the service is able to handle its own socket.
-`dgram` socket types must use `wait` while `stream` daemons, which are usually multi-threaded, should use `nowait`.
-`wait` usually hands off multiple sockets to a single daemon, while `nowait` spawns a child daemon for each new socket.
-+
-The maximum number of child daemons inetd may spawn is set by `max-child`.
-For example, to limit ten instances of the daemon, place a `/10` after `nowait`.
-Specifying `/0` allows an unlimited number of children.
-+
-`max-connections-per-ip-per-minute` limits the number of connections from any particular IP address per minute.
-Once the limit is reached, further connections from this IP address will be dropped until the end of the minute.
-For example, a value of `/10` would limit any particular IP address to ten connection attempts per minute.
-`max-child-per-ip` limits the number of child processes that can be started on behalf on any single IP address at any moment.
-These options can limit excessive resource consumption and help to prevent Denial of Service attacks.
-+
-An example can be seen in the default settings for man:fingerd[8]:
-+
-[.programlisting]
-....
-finger stream  tcp     nowait/3/10 nobody /usr/libexec/fingerd fingerd -k -s
-....
-
-user::
-The username the daemon will run as.
-Daemons typically run as `root`, `daemon`, or `nobody`.
-
-server-program::
-The full path to the daemon.
-If the daemon is a service provided by inetd internally, use `internal`.
-
-server-program-arguments::
-Used to specify any command arguments to be passed to the daemon on invocation.
-If the daemon is an internal service, use `internal`.
-
-[[network-inetd-cmdline]]
-=== Command-Line Options
-
-Like most server daemons, inetd has a number of options that can be used to modify its behavior.
-By default, inetd is started with `-wW -C 60`.
-These options enable TCP wrappers for all services, including internal services, and prevent any IP address from requesting any service more than 60 times per minute.
-
-To change the default options which are passed to inetd, add an entry for `inetd_flags` in [.filename]#/etc/rc.conf#.
-If inetd is already running, restart it with `service inetd restart`.
-
-The available rate limiting options are:
-
--c maximum::
-Specify the default maximum number of simultaneous invocations of each service, where the default is unlimited.
-May be overridden on a per-service basis by using `max-child` in [.filename]#/etc/inetd.conf#.
-
--C rate::
-Specify the default maximum number of times a service can be invoked from a single IP address per minute.
-May be overridden on a per-service basis by using `max-connections-per-ip-per-minute` in [.filename]#/etc/inetd.conf#.
-
--R rate::
-Specify the maximum number of times a service can be invoked in one minute, where the default is `256`.
-A rate of `0` allows an unlimited number.
-
--s maximum::
-Specify the maximum number of times a service can be invoked from a single IP address at any one time, where the default is unlimited.
-May be overridden on a per-service basis by using `max-child-per-ip` in [.filename]#/etc/inetd.conf#.
-
-Additional options are available. Refer to man:inetd[8] for the full list of options.
-
-[[network-inetd-security]]
-=== Security Considerations
-
-Many of the daemons which can be managed by inetd are not security-conscious.
-Some daemons, such as fingerd, can provide information that may be useful to an attacker.
-Only enable the services which are needed and monitor the system for excessive connection attempts.
-`max-connections-per-ip-per-minute`, `max-child` and `max-child-per-ip` can be used to limit such attacks.
-
-By default, TCP wrappers are enabled.
-Consult man:hosts_access[5] for more information on placing TCP restrictions on various inetd invoked daemons.
-
-[[network-nfs]]
-== Network File System (NFS)
-
-FreeBSD supports the Network File System (NFS), which allows a server to share directories and files with clients over a network.
-With NFS, users and programs can access files on remote systems as if they were stored locally.
-
-NFS has many practical uses.
-Some of the more common uses include:
-
-* Data that would otherwise be duplicated on each client can be kept in a single location and accessed by clients on the network.
-* Several clients may need access to the [.filename]#/usr/ports/distfiles# directory. Sharing that directory allows for quick access to the source files without having to download them to each client.
-* On large networks, it is often more convenient to configure a central NFS server on which all user home directories are stored. Users can log into a client anywhere on the network and have access to their home directories.
-* Administration of NFS exports is simplified. For example, there is only one file system where security or backup policies must be set.
-* Removable media storage devices can be used by other machines on the network. This reduces the number of devices throughout the network and provides a centralized location to manage their security. It is often more convenient to install software on multiple machines from a centralized installation media.
-
-NFS consists of a server and one or more clients.
-The client remotely accesses the data that is stored on the server machine.
-In order for this to function properly, a few processes have to be configured and running.
-
-These daemons must be running on the server:
-
-[.informaltable]
-[cols="1,1", frame="none", options="header"]
-|===
-| Daemon
-| Description
-
-
-|nfsd
-|The NFS daemon which services requests from NFS clients.
-
-|mountd
-|The NFS mount daemon which carries out requests received from nfsd.
-
-|rpcbind
-| This daemon allows NFS clients to discover which port the NFS server is using.
-|===
-
-Running man:nfsiod[8] on the client can improve performance, but is not required.
-
-[[network-configuring-nfs]]
-=== Configuring the Server
-
-The file systems which the NFS server will share are specified in [.filename]#/etc/exports#.
-Each line in this file specifies a file system to be exported, which clients have access to that file system, and any access options.
-When adding entries to this file, each exported file system, its properties, and allowed hosts must occur on a single line.
-If no clients are listed in the entry, then any client on the network can mount that file system.
-
-The following [.filename]#/etc/exports# entries demonstrate how to export file systems.
-The examples can be modified to match the file systems and client names on the reader's network.
-There are many options that can be used in this file, but only a few will be mentioned here.
-See man:exports[5] for the full list of options.
-
-This example shows how to export [.filename]#/cdrom# to three hosts named _alpha_, _bravo_, and _charlie_:
-
-[.programlisting]
-....
-/cdrom -ro alpha bravo charlie
-....
-
-The `-ro` flag makes the file system read-only, preventing clients from making any changes to the exported file system.
-This example assumes that the host names are either in DNS or in [.filename]#/etc/hosts#.
-Refer to man:hosts[5] if the network does not have a DNS server.
-
-The next example exports [.filename]#/home# to three clients by IP address.
-This can be useful for networks without DNS or [.filename]#/etc/hosts# entries.
-The `-alldirs` flag allows subdirectories to be mount points.
-In other words, it will not automatically mount the subdirectories, but will permit the client to mount the directories that are required as needed.
-
-[.programlisting]
-....
-/usr/home  -alldirs  10.0.0.2 10.0.0.3 10.0.0.4
-....
-
-This next example exports [.filename]#/a# so that two clients from different domains may access that file system.
-The `-maproot=root` allows `root` on the remote system to write data on the exported file system as `root`.
-If `-maproot=root` is not specified, the client's `root` user will be mapped to the server's `nobody` account and will be subject to the access limitations defined for `nobody`.
-
-[.programlisting]
-....
-/a  -maproot=root  host.example.com box.example.org
-....
-
-A client can only be specified once per file system.
-For example, if [.filename]#/usr# is a single file system, these entries would be invalid as both entries specify the same host:
-
-[.programlisting]
-....
-# Invalid when /usr is one file system
-/usr/src   client
-/usr/ports client
-....
-
-The correct format for this situation is to use one entry:
-
-[.programlisting]
-....
-/usr/src /usr/ports  client
-....
-
-The following is an example of a valid export list, where [.filename]#/usr# and [.filename]#/exports# are local file systems:
-
-[.programlisting]
-....
-# Export src and ports to client01 and client02, but only
-# client01 has root privileges on it
-/usr/src /usr/ports -maproot=root    client01
-/usr/src /usr/ports               client02
-# The client machines have root and can mount anywhere
-# on /exports. Anyone in the world can mount /exports/obj read-only
-/exports -alldirs -maproot=root      client01 client02
-/exports/obj -ro
-....
-
-To enable the processes required by the NFS server at boot time, add these options to [.filename]#/etc/rc.conf#:
-
-[.programlisting]
-....
-rpcbind_enable="YES"
-nfs_server_enable="YES"
-mountd_enable="YES"
-....
-
-The server can be started now by running this command:
-
-[source,shell]
-....
-# service nfsd start
-....
-
-Whenever the NFS server is started, mountd also starts automatically.
-However, mountd only reads [.filename]#/etc/exports# when it is started.
-To make subsequent [.filename]#/etc/exports# edits take effect immediately, force mountd to reread it:
-
-[source,shell]
-....
-# service mountd reload
-....
-
-Refer to man:nfsv4[4] for a description of an NFS Version 4 setup.
-
-=== Configuring the Client
-
-To enable NFS clients, set this option in each client's [.filename]#/etc/rc.conf#:
-
-[.programlisting]
-....
-nfs_client_enable="YES"
-....
-
-Then, run this command on each NFS client:
-
-[source,shell]
-....
-# service nfsclient start
-....
-
-The client now has everything it needs to mount a remote file system.
-In these examples, the server's name is `server` and the client's name is `client`.
-To mount [.filename]#/home# on `server` to the [.filename]#/mnt# mount point on `client`:
-
-[source,shell]
-....
-# mount server:/home /mnt
-....
-
-The files and directories in [.filename]#/home# will now be available on `client`, in the [.filename]#/mnt# directory.
-
-To mount a remote file system each time the client boots, add it to [.filename]#/etc/fstab#:
-
-[.programlisting]
-....
-server:/home	/mnt	nfs	rw	0	0
-....
-
-Refer to man:fstab[5] for a description of all available options.
-
-=== Locking
-
-Some applications require file locking to operate correctly.
-To enable locking, execute the following command on both the client and server:
-
-[source,shell]
-....
-# sysrc rpc_lockd_enable="YES"
-....
-
-Then start the service:
-
-[source,shell]
-....
-# service lockd start
-....
-
-If locking is not required on the server, the NFS client can be configured to lock locally by including `-L` when running mount.
-Refer to man:mount_nfs[8] for further details.
-
-[[network-autofs]]
-=== Automating Mounts with man:autofs[5]
-
-[NOTE]
-====
-The man:autofs[5] automount facility is supported starting with FreeBSD 10.1-RELEASE.
-To use the automounter functionality in older versions of FreeBSD, use man:amd[8] instead.
-This chapter only describes the man:autofs[5] automounter.
-====
-
-The man:autofs[5] facility is a common name for several components that, together, allow for automatic mounting of remote and local filesystems whenever a file or directory within that file system is accessed.
-It consists of the kernel component, man:autofs[5], and several userspace applications: man:automount[8], man:automountd[8] and man:autounmountd[8].
-It serves as an alternative for man:amd[8] from previous FreeBSD releases.
-amd is still provided for backward compatibility purposes, as the two use different map formats; the one used by autofs is the same as with other SVR4 automounters, such as the ones in Solaris, MacOS X, and Linux.
-
-The man:autofs[5] virtual filesystem is mounted on specified mountpoints by man:automount[8], usually invoked during boot.
-
-Whenever a process attempts to access a file within the man:autofs[5] mountpoint, the kernel will notify man:automountd[8] daemon and pause the triggering process.
-The man:automountd[8] daemon will handle kernel requests by finding the proper map and mounting the filesystem according to it, then signal the kernel to release blocked process.
-The man:autounmountd[8] daemon automatically unmounts automounted filesystems after some time, unless they are still being used.
-
-The primary autofs configuration file is [.filename]#/etc/auto_master#. It assigns individual maps to top-level mounts.
-For an explanation of [.filename]#auto_master# and the map syntax, refer to man:auto_master[5].
-
-There is a special automounter map mounted on [.filename]#/net#.
-When a file is accessed within this directory, man:autofs[5] looks up the corresponding remote mount and automatically mounts it.
-For instance, an attempt to access a file within [.filename]#/net/foobar/usr# would tell man:automountd[8] to mount the [.filename]#/usr# export from the host `foobar`.
-
-.Mounting an Export with man:autofs[5]
-[example]
-====
-In this example, `showmount -e` shows the exported file systems that can be mounted from the NFS server, `foobar`:
-
-[source,shell]
-....
-% showmount -e foobar
-Exports list on foobar:
-/usr                               10.10.10.0
-/a                                 10.10.10.0
-% cd /net/foobar/usr
-....
-
-====
-
-The output from `showmount` shows [.filename]#/usr# as an export.
-When changing directories to [.filename]#/host/foobar/usr#, man:automountd[8] intercepts the request and attempts to resolve the hostname `foobar`.
-If successful, man:automountd[8] automatically mounts the source export.
-
-To enable man:autofs[5] at boot time, add this line to [.filename]#/etc/rc.conf#:
-
-[.programlisting]
-....
-autofs_enable="YES"
-....
-
-Then man:autofs[5] can be started by running:
-
-[source,shell]
-....
-# service automount start
-# service automountd start
-# service autounmountd start
-....
-
-The man:autofs[5] map format is the same as in other operating systems.
-Information about this format from other sources can be useful, like the http://web.archive.org/web/20160813071113/http://images.apple.com/business/docs/Autofs.pdf[Mac OS X document].
-
-Consult the man:automount[8], man:automountd[8], man:autounmountd[8], and man:auto_master[5] manual pages for more information.
-
-[[network-nis]]
-== Network Information System (NIS)
-
-Network Information System (NIS) is designed to centralize administration of UNIX(R)-like systems such as Solaris(TM), HP-UX, AIX(R), Linux, NetBSD, OpenBSD, and FreeBSD.
-NIS was originally known as Yellow Pages but the name was changed due to trademark issues.
-This is the reason why NIS commands begin with `yp`.
-
-NIS is a Remote Procedure Call (RPC)-based client/server system that allows a group of machines within an NIS domain to share a common set of configuration files.
-This permits a system administrator to set up NIS client systems with only minimal configuration data and to add, remove, or modify configuration data from a single location.
-
-FreeBSD uses version 2 of the NIS protocol.
-
-=== NIS Terms and Processes
-
-Table 28.1 summarizes the terms and important processes used by NIS:
-
-.NIS Terminology
-[cols="1,1", frame="none", options="header"]
-|===
-| Term
-| Description
-
-|NIS domain name
-|NIS servers and clients share an NIS domain name. Typically, this name does not have anything to do with DNS.
-
-|man:rpcbind[8]
-|This service enables RPC and must be running in order to run an NIS server or act as an NIS client.
-
-|man:ypbind[8]
-|This service binds an NIS client to its NIS server. It will take the NIS domain name and use RPC to connect to the server. It is the core of client/server communication in an NIS environment. If this service is not running on a client machine, it will not be able to access the NIS server.
-
-|man:ypserv[8]
-|This is the process for the NIS server. If this service stops running, the server will no longer be able to respond to NIS requests so hopefully, there is a slave server to take over. Some non-FreeBSD clients will not try to reconnect using a slave server and the ypbind process may need to be restarted on these clients.
-
-|man:rpc.yppasswdd[8]
-|This process only runs on NIS master servers. This daemon allows NIS clients to change their NIS passwords. If this daemon is not running, users will have to login to the NIS master server and change their passwords there.
-|===
-
-=== Machine Types
-
-There are three types of hosts in an NIS environment:
-
-* NIS master server
-+
-This server acts as a central repository for host configuration information and maintains the authoritative copy of the files used by all of the NIS clients.
-The [.filename]#passwd#, [.filename]#group#, and other various files used by NIS clients are stored on the master server.
-While it is possible for one machine to be an NIS master server for more than one NIS domain, this type of configuration will not be covered in this chapter as it assumes a relatively small-scale NIS environment.
-* NIS slave servers
-+
-NIS slave servers maintain copies of the NIS master's data files in order to provide redundancy.
-Slave servers also help to balance the load of the master server as NIS clients always attach to the NIS server which responds first.
-* NIS clients
-+
-NIS clients authenticate against the NIS server during log on.
-
-Information in many files can be shared using NIS.
-The [.filename]#master.passwd#, [.filename]#group#, and [.filename]#hosts# files are commonly shared via NIS.
-Whenever a process on a client needs information that would normally be found in these files locally, it makes a query to the NIS server that it is bound to instead.
-
-=== Planning Considerations
-
-This section describes a sample NIS environment which consists of 15 FreeBSD machines with no centralized point of administration.
-Each machine has its own [.filename]#/etc/passwd# and [.filename]#/etc/master.passwd#.
-These files are kept in sync with each other only through manual intervention.
-Currently, when a user is added to the lab, the process must be repeated on all 15 machines.
-
-The configuration of the lab will be as follows:
-
-[.informaltable]
-[cols="1,1,1", frame="none", options="header"]
-|===
-| Machine name
-| IP address
-| Machine role
-
-
-|`ellington`
-|`10.0.0.2`
-|NIS master
-
-|`coltrane`
-|`10.0.0.3`
-|NIS slave
-
-|`basie`
-|`10.0.0.4`
-|Faculty workstation
-
-|`bird`
-|`10.0.0.5`
-|Client machine
-
-|`cli[1-11]`
-|`10.0.0.[6-17]`
-|Other client machines
-|===
-
-If this is the first time an NIS scheme is being developed, it should be thoroughly planned ahead of time.
-Regardless of network size, several decisions need to be made as part of the planning process.
-
-==== Choosing a NIS Domain Name
-
-When a client broadcasts its requests for info, it includes the name of the NIS domain that it is part of.
-This is how multiple servers on one network can tell which server should answer which request.
-Think of the NIS domain name as the name for a group of hosts.
-
-Some organizations choose to use their Internet domain name for their NIS domain name.
-This is not recommended as it can cause confusion when trying to debug network problems.
-The NIS domain name should be unique within the network and it is helpful if it describes the group of machines it represents.
-For example, the Art department at Acme Inc. might be in the "acme-art" NIS domain.
-This example will use the domain name `test-domain`.
-
-However, some non-FreeBSD operating systems require the NIS domain name to be the same as the Internet domain name.
-If one or more machines on the network have this restriction, the Internet domain name _must_ be used as the NIS domain name.
-
-==== Physical Server Requirements
-
-There are several things to keep in mind when choosing a machine to use as a NIS server.
-Since NIS clients depend upon the availability of the server, choose a machine that is not rebooted frequently.
-The NIS server should ideally be a stand alone machine whose sole purpose is to be an NIS server.
-If the network is not heavily used, it is acceptable to put the NIS server on a machine running other services.
-However, if the NIS server becomes unavailable, it will adversely affect all NIS clients.
-
-=== Configuring the NIS Master Server
-
-The canonical copies of all NIS files are stored on the master server.
-The databases used to store the information are called NIS maps.
-In FreeBSD, these maps are stored in [.filename]#/var/yp/[domainname]# where [.filename]#[domainname]# is the name of the NIS domain.
-Since multiple domains are supported, it is possible to have several directories, one for each domain.
-Each domain will have its own independent set of maps.
-
-NIS master and slave servers handle all NIS requests through man:ypserv[8].
-This daemon is responsible for receiving incoming requests from NIS clients, translating the requested domain and map name to a path to the corresponding database file, and transmitting data from the database back to the client.
-
-Setting up a master NIS server can be relatively straight forward, depending on environmental needs.
-Since FreeBSD provides built-in NIS support, it only needs to be enabled by adding the following lines to [.filename]#/etc/rc.conf#:
-
-[.programlisting]
-....
-nisdomainname="test-domain"	<.>
-nis_server_enable="YES"		<.>
-nis_yppasswdd_enable="YES"	<.>
-....
-
-<.> This line sets the NIS domain name to `test-domain`.
-<.> This automates the start up of the NIS server processes when the system boots.
-<.> This enables the man:rpc.yppasswdd[8] daemon so that users can change their NIS password from a client machine.
-
-Care must be taken in a multi-server domain where the server machines are also NIS clients.
-It is generally a good idea to force the servers to bind to themselves rather than allowing them to broadcast bind requests and possibly become bound to each other.
-Strange failure modes can result if one server goes down and others are dependent upon it.
-Eventually, all the clients will time out and attempt to bind to other servers, but the delay involved can be considerable and the failure mode is still present since the servers might bind to each other all over again.
-
-A server that is also a client can be forced to bind to a particular server by adding these additional lines to [.filename]#/etc/rc.conf#:
-
-[.programlisting]
-....
-nis_client_enable="YES"				<.>
-nis_client_flags="-S test-domain,server"	<.>
-....
-
-<.> This enables running client stuff as well.
-<.> This line sets the NIS domain name to `test-domain` and bind to itself.
-
-After saving the edits, type `/etc/netstart` to restart the network and apply the values defined in [.filename]#/etc/rc.conf#.
-Before initializing the NIS maps, start man:ypserv[8]:
-
-[source,shell]
-....
-# service ypserv start
-....
-
-
-==== Initializing the NIS Maps
-
-NIS maps are generated from the configuration files in [.filename]#/etc# on the NIS master, with one exception: [.filename]#/etc/master.passwd#.
-This is to prevent the propagation of passwords to all the servers in the NIS domain.
-Therefore, before the NIS maps are initialized, configure the primary password files:
-
-[source,shell]
-....
-# cp /etc/master.passwd /var/yp/master.passwd
-# cd /var/yp
-# vi master.passwd
-....
-
-It is advisable to remove all entries for system accounts as well as any user accounts that do not need to be propagated to the NIS clients, such as the `root` and any other administrative accounts.
-
-[NOTE]
-====
-Ensure that the [.filename]#/var/yp/master.passwd# is neither group or world readable by setting its permissions to `600`.
-====
-
-After completing this task, initialize the NIS maps.
-FreeBSD includes the man:ypinit[8] script to do this.
-When generating maps for the master server, include `-m` and specify the NIS domain name:
-
-[source,shell]
-....
-ellington# ypinit -m test-domain
-Server Type: MASTER Domain: test-domain
-Creating an YP server will require that you answer a few questions.
-Questions will all be asked at the beginning of the procedure.
-Do you want this procedure to quit on non-fatal errors? [y/n: n] n
-Ok, please remember to go back and redo manually whatever fails.
-If not, something might not work.
-At this point, we have to construct a list of this domains YP servers.
-rod.darktech.org is already known as master server.
-Please continue to add any slave servers, one per line. When you are
-done with the list, type a <control D>.
-master server   :  ellington
-next host to add:  coltrane
-next host to add:  ^D
-The current list of NIS servers looks like this:
-ellington
-coltrane
-Is this correct?  [y/n: y] y
-
-[..output from map generation..]
-
-NIS Map update completed.
-ellington has been setup as an YP master server without any errors.
-....
-
-This will create [.filename]#/var/yp/Makefile# from [.filename]#/var/yp/Makefile.dist#.
-By default, this file assumes that the environment has a single NIS server with only FreeBSD clients.
-Since `test-domain` has a slave server, edit this line in [.filename]#/var/yp/Makefile# so that it begins with a comment (`+#+`):
-
-[.programlisting]
-....
-NOPUSH = "True"
-....
-
-
-==== Adding New Users
-
-Every time a new user is created, the user account must be added to the master NIS server and the NIS maps rebuilt.
-Until this occurs, the new user will not be able to login anywhere except on the NIS master.
-For example, to add the new user `jsmith` to the `test-domain` domain, run these commands on the master server:
-
-[source,shell]
-....
-# pw useradd jsmith
-# cd /var/yp
-# make test-domain
-....
-
-The user could also be added using `adduser jsmith` instead of `pw useradd smith`.
-
-=== Setting up a NIS Slave Server
-
-To set up an NIS slave server, log on to the slave server and edit [.filename]#/etc/rc.conf# as for the master server.
-Do not generate any NIS maps, as these already exist on the master server.
-When running `ypinit` on the slave server, use `-s` (for slave) instead of `-m` (for master).
-This option requires the name of the NIS master in addition to the domain name, as seen in this example:
-
-[source,shell]
-....
-coltrane# ypinit -s ellington test-domain
-
-Server Type: SLAVE Domain: test-domain Master: ellington
-
-Creating an YP server will require that you answer a few questions.
-Questions will all be asked at the beginning of the procedure.
-
-Do you want this procedure to quit on non-fatal errors? [y/n: n]  n
-
-Ok, please remember to go back and redo manually whatever fails.
-If not, something might not work.
-There will be no further questions. The remainder of the procedure
-should take a few minutes, to copy the databases from ellington.
-Transferring netgroup...
-ypxfr: Exiting: Map successfully transferred
-Transferring netgroup.byuser...
-ypxfr: Exiting: Map successfully transferred
-Transferring netgroup.byhost...
-ypxfr: Exiting: Map successfully transferred
-Transferring master.passwd.byuid...
-ypxfr: Exiting: Map successfully transferred
-Transferring passwd.byuid...
-ypxfr: Exiting: Map successfully transferred
-Transferring passwd.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring group.bygid...
-ypxfr: Exiting: Map successfully transferred
-Transferring group.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring services.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring rpc.bynumber...
-ypxfr: Exiting: Map successfully transferred
-Transferring rpc.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring protocols.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring master.passwd.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring networks.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring networks.byaddr...
-ypxfr: Exiting: Map successfully transferred
-Transferring netid.byname...
-ypxfr: Exiting: Map successfully transferred
-Transferring hosts.byaddr...
-ypxfr: Exiting: Map successfully transferred
-Transferring protocols.bynumber...
-ypxfr: Exiting: Map successfully transferred
-Transferring ypservers...
-ypxfr: Exiting: Map successfully transferred
-Transferring hosts.byname...
-ypxfr: Exiting: Map successfully transferred
-
-coltrane has been setup as an YP slave server without any errors.
-Remember to update map ypservers on ellington.
-....
-
-This will generate a directory on the slave server called [.filename]#/var/yp/test-domain# which contains copies of the NIS master server's maps.
-Adding these [.filename]#/etc/crontab# entries on each slave server will force the slaves to sync their maps with the maps on the master server:
-
-[.programlisting]
-....
-20      *       *       *       *       root   /usr/libexec/ypxfr passwd.byname
-21      *       *       *       *       root   /usr/libexec/ypxfr passwd.byuid
-....
-
-These entries are not mandatory because the master server automatically attempts to push any map changes to its slaves.
-However, since clients may depend upon the slave server to provide correct password information, it is recommended to force frequent password map updates.
-This is especially important on busy networks where map updates might not always complete.
-
-To finish the configuration, run `/etc/netstart` on the slave server in order to start the NIS services.
-
-=== Setting Up an NIS Client
-
-An NIS client binds to an NIS server using man:ypbind[8].
-This daemon broadcasts RPC requests on the local network.
-These requests specify the domain name configured on the client.
-If an NIS server in the same domain receives one of the broadcasts, it will respond to ypbind, which will record the server's address.
-If there are several servers available, the client will use the address of the first server to respond and will direct all of its NIS requests to that server.
-The client will automatically ping the server on a regular basis to make sure it is still available.
-If it fails to receive a reply within a reasonable amount of time, ypbind will mark the domain as unbound and begin broadcasting again in the hopes of locating another server.
-
-To configure a FreeBSD machine to be an NIS client:
-
-[.procedure]
-====
-. Edit [.filename]#/etc/rc.conf# and add the following lines in order to set the NIS domain name and start man:ypbind[8] during network startup:
-+
-[.programlisting]
-....
-nisdomainname="test-domain"
-nis_client_enable="YES"
-....
-
-. To import all possible password entries from the NIS server, use `vipw` to remove all user accounts except one from [.filename]#/etc/master.passwd#. When removing the accounts, keep in mind that at least one local account should remain and this account should be a member of `wheel`. If there is a problem with NIS, this local account can be used to log in remotely, become the superuser, and fix the problem. Before saving the edits, add the following line to the end of the file:
-+
-[.programlisting]
-....
-+:::::::::
-....
-+
-This line configures the client to provide anyone with a valid account in the NIS server's password maps an account on the client.
-There are many ways to configure the NIS client by modifying this line.
-One method is described in <<network-netgroups>>.
-For more detailed reading, refer to the book `Managing NFS and NIS`, published by O'Reilly Media.
-. To import all possible group entries from the NIS server, add this line to [.filename]#/etc/group#:
-+
-[.programlisting]
-....
-+:*::
-....
-====
-
-To start the NIS client immediately, execute the following commands as the superuser:
-
-[source,shell]
-....
-# /etc/netstart
-# service ypbind start
-....
-
-After completing these steps, running `ypcat passwd` on the client should show the server's [.filename]#passwd# map.
-
-=== NIS Security
-
-Since RPC is a broadcast-based service, any system running ypbind within the same domain can retrieve the contents of the NIS maps.
-To prevent unauthorized transactions, man:ypserv[8] supports a feature called "securenets" which can be used to restrict access to a given set of hosts.
-By default, this information is stored in [.filename]#/var/yp/securenets#, unless man:ypserv[8] is started with `-p` and an alternate path.
-This file contains entries that consist of a network specification and a network mask separated by white space.
-Lines starting with `+"#"+` are considered to be comments.
-A sample [.filename]#securenets# might look like this:
-
-[.programlisting]
-....
-# allow connections from local host -- mandatory
-127.0.0.1     255.255.255.255
-# allow connections from any host
-# on the 192.168.128.0 network
-192.168.128.0 255.255.255.0
-# allow connections from any host
-# between 10.0.0.0 to 10.0.15.255
-# this includes the machines in the testlab
-10.0.0.0      255.255.240.0
-....
-
-If man:ypserv[8] receives a request from an address that matches one of these rules, it will process the request normally.
-If the address fails to match a rule, the request will be ignored and a warning message will be logged.
-If the [.filename]#securenets# does not exist, `ypserv` will allow connections from any host.
-
-crossref:security[tcpwrappers,"TCP Wrapper"] is an alternate mechanism for providing access control instead of [.filename]#securenets#.
-While either access control mechanism adds some security, they are both vulnerable to "IP spoofing" attacks.
-All NIS-related traffic should be blocked at the firewall.
-
-Servers using [.filename]#securenets# may fail to serve legitimate NIS clients with archaic TCP/IP implementations.
-Some of these implementations set all host bits to zero when doing broadcasts or fail to observe the subnet mask when calculating the broadcast address.
-While some of these problems can be fixed by changing the client configuration, other problems may force the retirement of these client systems or the abandonment of [.filename]#securenets#.
-
-The use of TCP Wrapper increases the latency of the NIS server.
-The additional delay may be long enough to cause timeouts in client programs, especially in busy networks with slow NIS servers.
-If one or more clients suffer from latency, convert those clients into NIS slave servers and force them to bind to themselves.
-
-==== Barring Some Users
-
-In this example, the `basie` system is a faculty workstation within the NIS domain.
-The [.filename]#passwd# map on the master NIS server contains accounts for both faculty and students.
-This section demonstrates how to allow faculty logins on this system while refusing student logins.
-
-To prevent specified users from logging on to a system, even if they are present in the NIS database, use `vipw` to add `-_username_` with the correct number of colons towards the end of [.filename]#/etc/master.passwd# on the client, where _username_ is the username of a user to bar from logging in.
-The line with the blocked user must be before the `+` line that allows NIS users.
-In this example, `bill` is barred from logging on to `basie`:
-
*** 2053 LINES SKIPPED ***