From 9da96bc7f14c740fe888bcfa9c531f0cbab8c7d8 Mon Sep 17 00:00:00 2001 From: Glen Barber Date: Sun, 5 Feb 2012 06:40:54 +0000 Subject: [PATCH] - Rewrap closing tags that should be on the same line as content - Use two spaces between sentences - Cleanup leading and trailing whitespace - Rewrap long lines - Reindent sections as needed Translators, please ignore this change Spotted by: textproc/igor --- .../handbook/network-servers/chapter.sgml | 3886 +++++++++-------- 1 file changed, 2025 insertions(+), 1861 deletions(-) diff --git a/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml b/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml index 7740fe1ef2..8731789978 100644 --- a/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/network-servers/chapter.sgml @@ -8,7 +8,7 @@ - Murray + Murray Stokely Reorganized by @@ -46,7 +46,8 @@ - How to set up automatic network settings using DHCP. + How to set up automatic network settings using + DHCP. @@ -54,11 +55,13 @@ - How to set up the Apache HTTP Server. + How to set up the Apache + HTTP Server. - How to set up a File Transfer Protocol (FTP) Server. + How to set up a File Transfer Protocol (FTP) + Server. @@ -92,8 +95,8 @@ - Know how to install additional third-party - software (). + Know how to install additional third-party + software (). @@ -102,11 +105,11 @@ - - Chern - Lee - Contributed by - + + Chern + Lee + Contributed by + @@ -116,22 +119,24 @@ - The <application>inetd</application> <quote>Super-Server</quote> + The <application>inetd</application> + <quote>Super-Server</quote> Overview - &man.inetd.8; is sometimes referred to as the Internet - Super-Server because it manages connections for - several services. When a - connection is received by inetd, it - determines which program the connection is destined for, spawns - the particular process and delegates the socket to it (the program - is invoked with the service socket as its standard input, output - and error descriptors). Running - inetd for servers that are not heavily used can reduce the - overall system load, when compared to running each daemon - individually in stand-alone mode. + &man.inetd.8; is sometimes referred to as the + Internet Super-Server because it manages + connections for several services. When a connection is + received by inetd, it determines + which program the connection is destined for, spawns the + particular process and delegates the socket to it (the program + is invoked with the service socket as its standard input, + output and error descriptors). Running + inetd for servers that are not + heavily used can reduce the overall 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 @@ -156,11 +161,11 @@ depending on the configuration chosen by the user. Placing: - inetd_enable="YES" + inetd_enable="YES" or - inetd_enable="NO" + inetd_enable="NO" into /etc/rc.conf will enable or disable @@ -185,21 +190,21 @@ modify its behaviour. See the &man.inetd.8; manual page for the full list of options. - Options can be passed to inetd using the - inetd_flags option in + Options can be passed to inetd + using the inetd_flags option in /etc/rc.conf. By default, inetd_flags is set to -wW -C 60, which turns on TCP wrapping for inetd's services, and prevents any - single IP address from requesting any service more than 60 times - in any given minute. + single IP address from requesting any service more than 60 + times in any given minute. Although we mention rate-limiting options below, novice users may be pleased to note that these parameters usually do - not need to be modified. These options may be useful should you - find that you are receiving an excessive amount of connections. - A full list of options can be found in the &man.inetd.8; - manual. + not need to be modified. These options may be useful should + you find that you are receiving an excessive amount of + connections. A full list of options can be found in the + &man.inetd.8; manual. @@ -219,8 +224,8 @@ Specify the default maximum number of times a service can be invoked from a single IP address in one - minute; the default is unlimited. May be overridden on a - per-service basis with the + minute; the default is unlimited. May be overridden on + a per-service basis with the parameter. @@ -242,9 +247,9 @@ Specify the maximum number of times a service can be invoked from a single IP address at any one time; the - default is unlimited. May be overridden on a per-service - basis with the - parameter. + default is unlimited. May be overridden on a + per-service basis with the + parameter. @@ -380,22 +385,24 @@ server-program-arguments using the option. If a limit of ten instances of a particular daemon is needed, a /10 would be placed after - . Specifying /0 - allows an unlimited number of children + . Specifying + /0 allows an unlimited number of + children In addition to , two other - options which limit the maximum connections from a single - place to a particular daemon can be enabled. - limits - the number of connections from any particular IP address - per minutes, e.g., a value of ten would limit any particular - IP address connecting to a particular service to ten - attempts per minute. - limits the number of children that can be started on - behalf on any single IP address at any moment. These - options are useful to prevent intentional or unintentional - excessive resource consumption and Denial of Service (DoS) - attacks to a machine. + options which limit the maximum connections from a + single place to a particular daemon can be enabled. + + limits the number of connections from any particular IP + address per minutes, e.g., a value of ten would limit + any particular IP address connecting to a particular + service to ten attempts per minute. + limits the number of + children that can be started on behalf on any single IP + address at any moment. These options are useful to + prevent intentional or unintentional excessive resource + consumption and Denial of Service (DoS) attacks to a + machine. In this field, either of or is mandatory. @@ -437,10 +444,10 @@ server-program-arguments This is the username that the particular daemon should run as. Most commonly, daemons run as the - root user. For security purposes, it is - common to find some servers running as the - daemon user, or the least privileged - nobody user. + root user. For security purposes, + it is common to find some servers running as the + daemon user, or the least + privileged nobody user. @@ -480,26 +487,28 @@ server-program-arguments Depending on the choices made at install time, many of inetd's services may be enabled by default. If there is no apparent need for a particular - daemon, consider disabling it. Place a # in front of the - daemon in question in /etc/inetd.conf, - and then reload the + daemon, consider disabling it. Place a # in + front of the daemon in question in + /etc/inetd.conf, and then reload the inetd configuration. Some daemons, such as fingerd, may not be desired at all because they provide information that may be useful to an attacker. Some daemons are not security-conscious and have long, or - non-existent, timeouts for connection attempts. This allows an - attacker to slowly send connections to a particular daemon, + non-existent, timeouts for connection attempts. This allows + an attacker to slowly send connections to a particular daemon, thus saturating available resources. It may be a good idea to place , - or limitations on certain + or + limitations on certain daemons if you find that you have too many connections. By default, TCP wrapping is turned on. Consult the - &man.hosts.access.5; manual page for more information on placing - TCP restrictions on various inetd - invoked daemons. + &man.hosts.access.5; manual page for more information on + placing TCP restrictions on various + inetd invoked daemons. @@ -516,7 +525,8 @@ server-program-arguments The auth service provides identity network services, and is - configurable to a certain degree, whilst the others are simply on or off. + configurable to a certain degree, whilst the others are simply + on or off. Consult the &man.inetd.8; manual page for more in-depth information. @@ -526,18 +536,18 @@ server-program-arguments - - Tom - Rhodes - Reorganized and enhanced by - + + Tom + Rhodes + Reorganized and enhanced by + - - Bill - Swingle + + Bill + Swingle Written by - + Network File System (NFS) @@ -571,9 +581,9 @@ server-program-arguments Storage devices such as floppy disks, CDROM drives, and - &iomegazip; drives can be used by other machines on the network. - This may reduce the number of removable media drives - throughout the network. + &iomegazip; drives can be used by other machines on the + network. This may reduce the number of removable media + drives throughout the network. @@ -581,29 +591,29 @@ server-program-arguments How <acronym>NFS</acronym> Works NFS consists of at least two main - parts: 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. + parts: 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. The server has to be running the following daemons: - NFS - server + NFS + server - file server - UNIX clients + file server + UNIX clients rpcbind - mountd + mountd - nfsd + nfsd @@ -621,91 +631,91 @@ server-program-arguments nfsd The NFS daemon which services - requests from the NFS - clients. + requests from the NFS + clients. mountd - The NFS mount daemon which carries out - the requests that &man.nfsd.8; passes on to it. + The NFS mount daemon which + carries out the requests that &man.nfsd.8; passes on + to it. rpcbind This daemon allows - NFS clients to discover which port - the NFS server is using. + NFS clients to discover which port + the NFS server is using. The client can also run a daemon, known as - nfsiod. The - nfsiod daemon services the requests - from the NFS server. This is optional, and - improves performance, but is not required for normal and - correct operation. See the &man.nfsiod.8; manual page for - more information. - + nfsiod. The + nfsiod daemon services the requests + from the NFS server. This is optional, and + improves performance, but is not required for normal and + correct operation. See the &man.nfsiod.8; manual page for + more information. Configuring <acronym>NFS</acronym> - NFS - configuration + NFS + configuration NFS configuration is a relatively - straightforward process. The processes that need to be - running can all start at boot time with a few modifications to - your /etc/rc.conf file. + straightforward process. The processes that need to be + running can all start at boot time with a few modifications to + your /etc/rc.conf file. On the NFS server, make sure that the - following options are configured in the - /etc/rc.conf file: + following options are configured in the + /etc/rc.conf file: rpcbind_enable="YES" nfs_server_enable="YES" mountd_flags="-r" mountd runs automatically - whenever the NFS server is enabled. + whenever the NFS server is enabled. On the client, make sure this option is present in - /etc/rc.conf: + /etc/rc.conf: nfs_client_enable="YES" The /etc/exports file specifies which - file systems NFS should export (sometimes - referred to as share). Each line in - /etc/exports specifies a file system to be - exported and which machines have access to that file system. - Along with what machines have access to that file system, - access options may also be specified. There are many such - options that can be used in this file but only a few will be - mentioned here. You can easily discover other options by - reading over the &man.exports.5; manual page. + file systems NFS should export (sometimes + referred to as share). Each line in + /etc/exports specifies a file system to + be exported and which machines have access to that file + system. Along with what machines have access to that file + system, access options may also be specified. There are many + such options that can be used in this file but only a few will + be mentioned here. You can easily discover other options by + reading over the &man.exports.5; manual page. Here are a few example /etc/exports entries: - NFS - export examples + NFS + export examples The following examples give an idea of how to export - file systems, although the settings may be different depending - on your environment and network configuration. For instance, - to export the /cdrom directory to three - example machines that have the same domain name as the server - (hence the lack of a domain name for each) or have entries in - your /etc/hosts file. The - flag makes the exported file system - read-only. With this flag, the remote system will not be able - to write any changes to the exported file system. + file systems, although the settings may be different depending + on your environment and network configuration. For instance, + to export the /cdrom directory to three + example machines that have the same domain name as the server + (hence the lack of a domain name for each) or have entries in + your /etc/hosts file. The + flag makes the exported file system + read-only. With this flag, the remote system will not be able + to write any changes to the exported file system. /cdrom -ro host1 host2 host3 @@ -741,8 +751,8 @@ mountd_flags="-r" In /etc/exports, each line represents the export information for one file system to one host. A - remote host can only be specified once per file system, and may - only have one default entry. For example, assume that + remote host can only be specified once per file system, and + may only have one default entry. For example, assume that /usr is a single file system. The following /etc/exports would be invalid: @@ -753,7 +763,7 @@ mountd_flags="-r" One file system, /usr, has two lines specifying exports to the same host, client. - The correct format for this situation is: + The correct format for this situation is: /usr/src /usr/ports client @@ -775,15 +785,16 @@ mountd_flags="-r" /exports -alldirs -maproot=root client01 client02 /exports/obj -ro - The mountd daemon must be forced to - recheck the /etc/exports file whenever it has - been modified, so the changes can take effect. This can be - accomplished either by sending a HUP signal to the running daemon: + The mountd daemon must be + forced to recheck the /etc/exports file + whenever it has been modified, so the changes can take effect. + This can be accomplished either by sending a HUP signal to the + running daemon: &prompt.root; kill -HUP `cat /var/run/mountd.pid` - or by invoking the mountd &man.rc.8; script - with the appropriate parameter: + or by invoking the mountd &man.rc.8; + script with the appropriate parameter: &prompt.root; /etc/rc.d/mountd onereload @@ -791,9 +802,9 @@ mountd_flags="-r" information about using rc scripts. Alternatively, a reboot will make FreeBSD set everything - up properly. A reboot is not necessary though. - Executing the following commands as root - should start everything up. + up properly. A reboot is not necessary though. + Executing the following commands as root + should start everything up. On the NFS server: @@ -805,16 +816,17 @@ mountd_flags="-r" &prompt.root; nfsiod -n 4 - Now everything should be ready to actually mount a remote file - system. In these examples the - server's name will be server and the client's - name will be client. If you only want to - temporarily mount a remote file system or would rather test the - configuration, just execute a command like this as root on the - client: + Now everything should be ready to actually mount a remote + file system. In these examples the server's name will be + server and the client's name will be + client. If you only want to temporarily + mount a remote file system or would rather test the + configuration, just execute a command like this as + root on the client: + - NFS - mounting + NFS + mounting &prompt.root; mount server:/home /mnt @@ -822,16 +834,17 @@ mountd_flags="-r" on the server at /mnt on the client. If everything is set up correctly you should be able to enter /mnt on the client and see all the files - that are on the server. + that are on the server. If you want to automatically mount a remote file system each time the computer boots, add the file system to the - /etc/fstab file. Here is an example: + /etc/fstab file. Here is an + example: server:/home /mnt nfs rw 0 0 The &man.fstab.5; manual page lists all the available - options. + options. @@ -857,22 +870,22 @@ rpc_statd_enable="YES" and NFS server is not required, it is possible to let the NFS client do locking locally by passing to &man.mount.nfs.8;. - Refer to the &man.mount.nfs.8; manual page for further details. - + Refer to the &man.mount.nfs.8; manual page for further + details. Practical Uses NFS has many practical uses. Some of - the more common ones are listed below: + the more common ones are listed below: - NFS - uses + NFS + uses - + Set several machines to share a CDROM or other media among them. This is cheaper and often a more convenient method to install software on multiple machines. @@ -889,10 +902,10 @@ rpc_statd_enable="YES" Several machines could have a common - /usr/ports/distfiles directory. That - way, when you need to install a port on several machines, - you can quickly access the source without downloading it - on each machine. + /usr/ports/distfiles directory. That + way, when you need to install a port on several machines, + you can quickly access the source without downloading it + on each machine. @@ -914,10 +927,13 @@ rpc_statd_enable="YES" - Automatic Mounts with <application>amd</application> + Automatic Mounts with + <application>amd</application> amd - automatic mounter daemon + + automatic mounter daemon + &man.amd.8; (the automatic mounter daemon) automatically mounts a @@ -927,15 +943,16 @@ rpc_statd_enable="YES" amd. Using amd provides a simple alternative to permanent mounts, as permanent mounts are usually listed in - /etc/fstab. + /etc/fstab. amd operates by attaching itself as an NFS server to the /host and - /net directories. When a file is accessed - within one of these directories, amd - looks up the corresponding remote mount and automatically mounts - it. /net is used to mount an exported - file system from an IP address, while /host + /net directories. When a file is + accessed within one of these directories, + amd looks up the corresponding + remote mount and automatically mounts it. + /net is used to mount an exported file + system from an IP address, while /host is used to mount an export from a remote hostname. An access to a file within @@ -945,7 +962,8 @@ rpc_statd_enable="YES" foobar. - Mounting an Export with <application>amd</application> + Mounting an Export with + <application>amd</application> You can view the available mounts of a remote host with the showmount command. For example, to @@ -959,11 +977,12 @@ Exports list on foobar: &prompt.user; cd /host/foobar/usr - As seen in the example, the showmount shows - /usr as an export. When changing directories to - /host/foobar/usr, amd - attempts to resolve the hostname foobar and - automatically mount the desired export. + As seen in the example, the showmount + shows /usr as an export. When changing + directories to /host/foobar/usr, + amd attempts to resolve the + hostname foobar and automatically mount the + desired export. amd can be started by the startup scripts by placing the following lines in @@ -972,50 +991,51 @@ Exports list on foobar: amd_enable="YES" Additionally, custom flags can be passed to - amd from the - amd_flags option. By default, - amd_flags is set to: + amd from the + amd_flags option. By default, + amd_flags is set to: amd_flags="-a /.amd_mnt -l syslog /host /etc/amd.map /net /etc/amd.map" The /etc/amd.map file defines the default options that exports are mounted with. The - /etc/amd.conf file defines some of the more - advanced features of amd. + /etc/amd.conf file defines some of the + more advanced features of + amd. - Consult the &man.amd.8; and &man.amd.conf.5; manual pages for more - information. + Consult the &man.amd.8; and &man.amd.conf.5; manual pages + for more information. - - - John - Lind - Contributed by - - + + + John + Lind + Contributed by + + Problems Integrating with Other Systems - Certain Ethernet adapters for ISA PC systems have limitations - which can lead to serious network problems, particularly with NFS. - This difficulty is not specific to FreeBSD, but FreeBSD systems - are affected by it. + Certain Ethernet adapters for ISA PC systems have + limitations which can lead to serious network problems, + particularly with NFS. This difficulty is not specific to + FreeBSD, but FreeBSD systems are affected by it. - The problem nearly always occurs when (FreeBSD) PC systems are - networked with high-performance workstations, such as those made - by Silicon Graphics, Inc., and Sun Microsystems, Inc. The NFS - mount will work fine, and some operations may succeed, but - suddenly the server will seem to become unresponsive to the - client, even though requests to and from other systems continue to - be processed. This happens to the client system, whether the - client is the FreeBSD system or the workstation. On many systems, - there is no way to shut down the client gracefully once this - problem has manifested itself. The only solution is often to - reset the client, because the NFS situation cannot be - resolved. + The problem nearly always occurs when (FreeBSD) PC systems + are networked with high-performance workstations, such as + those made by Silicon Graphics, Inc., and Sun Microsystems, + Inc. The NFS mount will work fine, and some operations may + succeed, but suddenly the server will seem to become + unresponsive to the client, even though requests to and from + other systems continue to be processed. This happens to the + client system, whether the client is the FreeBSD system or the + workstation. On many systems, there is no way to shut down + the client gracefully once this problem has manifested itself. + The only solution is often to reset the client, because the + NFS situation cannot be resolved. Though the correct solution is to get a higher performance and capacity Ethernet adapter for the @@ -1034,20 +1054,20 @@ Exports list on foobar: sometimes mistaken for this one, when the NFS servers and clients are on different networks. If that is the case, make certain that your routers are routing the - necessary UDP information, or you will not get anywhere, no - matter what else you are doing. + necessary UDP information, or you will not + get anywhere, no matter what else you are doing. - In the following examples, fastws is the host - (interface) name of a high-performance workstation, and - freebox is the host (interface) name of a FreeBSD - system with a lower-performance Ethernet adapter. Also, - /sharedfs will be the exported NFS + In the following examples, fastws is the + host (interface) name of a high-performance workstation, and + freebox is the host (interface) name of a + FreeBSD system with a lower-performance Ethernet adapter. + Also, /sharedfs will be the exported NFS file system (see &man.exports.5;), and /project will be the mount point on the client for the exported file system. In all cases, note that additional options, such as or - and may be desirable in - your application. + and may be desirable + in your application. Examples for the FreeBSD system (freebox) as the client in /etc/fstab on @@ -1055,7 +1075,8 @@ Exports list on foobar: fastws:/sharedfs /project nfs rw,-r=1024 0 0 - As a manual mount command on freebox: + As a manual mount command on + freebox: &prompt.root; mount -t nfs -o -r=1024 fastws:/sharedfs /project @@ -1065,12 +1086,14 @@ Exports list on foobar: freebox:/sharedfs /project nfs rw,-w=1024 0 0 - As a manual mount command on fastws: + As a manual mount command on + fastws: &prompt.root; mount -t nfs -o -w=1024 freebox:/sharedfs /project Nearly any 16-bit Ethernet adapter will allow operation - without the above restrictions on the read or write size. + without the above restrictions on the read or write + size. For anyone who cares, here is what happens when the failure occurs, which also explains why it is unrecoverable. @@ -1109,11 +1132,11 @@ Exports list on foobar: - - Bill - Swingle + + Bill + Swingle Written by - + @@ -1140,15 +1163,18 @@ Exports list on foobar: OpenBSD NIS, - which stands for Network Information Services, was developed - by Sun Microsystems to centralize administration of &unix; - (originally &sunos;) systems. It has now essentially become - an industry standard; all major &unix; like systems - (&solaris;, HP-UX, &aix;, Linux, NetBSD, OpenBSD, FreeBSD, - etc) support NIS. + which stands for Network Information Services, was developed + by Sun Microsystems to centralize administration of &unix; + (originally &sunos;) systems. It has now essentially become + an industry standard; all major &unix; like systems + (&solaris;, HP-UX, &aix;, Linux, NetBSD, OpenBSD, FreeBSD, + etc) support NIS. - yellow pagesNIS + + yellow pages + NIS + NIS was formerly known as Yellow Pages, but because of trademark @@ -1156,8 +1182,8 @@ Exports list on foobar: often seen and used. - NIS - domains + NIS + domains It is a RPC-based client/server system that allows a group @@ -1170,17 +1196,17 @@ Exports list on foobar: Windows NT It is similar to the &windowsnt; domain system; although - the internal implementation of the two are not at all similar, - the basic functionality can be compared. + the internal implementation of the two are not at all similar, + the basic functionality can be compared. Terms/Processes You Should Know There are several terms and several important user - processes that you will come across when attempting to - implement NIS on FreeBSD, whether you are trying to create an - NIS server or act as an NIS client: + processes that you will come across when attempting to + implement NIS on FreeBSD, whether you are trying to create an + NIS server or act as an NIS client: rpcbind @@ -1245,16 +1271,16 @@ Exports list on foobar: that helps in this case is to restart the server process (or even the whole server) or the ypbind process on the - client. - + client. rpc.yppasswdd Another process that should only be running on - NIS master servers; this is a daemon that will allow 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. + NIS master servers; this is a daemon that will allow + 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. @@ -1284,52 +1310,52 @@ Exports list on foobar: bound to instead. - Machine Types + Machine Types - + NIS master server - - A NIS master server. This - server, analogous to a &windowsnt; primary domain - controller, maintains the files used by all of the NIS - clients. The passwd, - group, and other various files used - by the NIS clients live on the master server. + + A NIS master server. This + server, analogous to a &windowsnt; primary domain + controller, maintains the files used by all of the NIS + clients. The passwd, + group, and other various files used + by the NIS clients live on the master server. - It is possible for one machine to be an NIS - master server for more than one NIS domain. However, - this will not be covered in this introduction, which - assumes a relatively small-scale NIS - environment. - + It is possible for one machine to be an NIS + master server for more than one NIS domain. However, + this will not be covered in this introduction, which + assumes a relatively small-scale NIS + environment. + NIS slave server - - NIS slave servers. Similar to - the &windowsnt; backup domain controllers, NIS slave - servers maintain copies of the NIS master's data files. - NIS slave servers provide the redundancy, which is - needed in important environments. They also help to - balance the load of the master server: NIS Clients - always attach to the NIS server whose response they get - first, and this includes slave-server-replies. - + + NIS slave servers. Similar to + the &windowsnt; backup domain controllers, NIS slave + servers maintain copies of the NIS master's data files. + NIS slave servers provide the redundancy, which is + needed in important environments. They also help to + balance the load of the master server: NIS Clients + always attach to the NIS server whose response they get + first, and this includes slave-server-replies. + NIS client - - NIS clients. NIS clients, like - most &windowsnt; workstations, authenticate against the - NIS server (or the &windowsnt; domain controller in the - &windowsnt; workstations case) to log on. - - + + NIS clients. NIS clients, like + most &windowsnt; workstations, authenticate against the + NIS server (or the &windowsnt; domain controller in the + &windowsnt; workstations case) to log on. + + @@ -1337,79 +1363,80 @@ Exports list on foobar: Using NIS/YP This section will deal with setting up a sample NIS - environment. + environment. - Planning + Planning - Let us assume that you are the administrator of a small - university lab. This lab, which consists of 15 FreeBSD - machines, currently has no centralized point of - administration; each machine has its own - /etc/passwd and - /etc/master.passwd. These files are - kept in sync with each other only through manual - intervention; currently, when you add a user to the lab, you - must run adduser on all 15 machines. - Clearly, this has to change, so you have decided to convert - the lab to use NIS, using two of the machines as - servers. + Let us assume that you are the administrator of a small + university lab. This lab, which consists of 15 FreeBSD + machines, currently has no centralized point of + administration; each machine has its own + /etc/passwd and + /etc/master.passwd. These files are + kept in sync with each other only through manual + intervention; currently, when you add a user to the lab, you + must run adduser on all 15 machines. + Clearly, this has to change, so you have decided to convert + the lab to use NIS, using two of the machines as + servers. - Therefore, the configuration of the lab now looks something - like: + Therefore, the configuration of the lab now looks + something like: - - - - - 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 - - - - + + + + + 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 you are setting up a NIS scheme for the first time, it - is a good idea to think through how you want to go about it. No - matter what the size of your network, there are a few decisions - that need to be made. + If you are setting up a NIS scheme for the first time, + it is a good idea to think through how you want to go about + it. No matter what the size of your network, there are a + few decisions that need to be made. - - Choosing a NIS Domain Name + + Choosing a NIS Domain Name NIS domainname - This might not be the domainname that + This might not be the domainname that you are used to. It is more accurately called the NIS domainname. When a client broadcasts its requests for info, it includes the name of the NIS @@ -1430,15 +1457,15 @@ Exports list on foobar: test-domain. SunOS - However, some operating systems (notably &sunos;) use - their NIS domain name as their Internet domain name. If one - or more machines on your network have this restriction, you - must use the Internet domain name as - your NIS domain name. - + However, some operating systems (notably &sunos;) use + their NIS domain name as their Internet domain name. If + one or more machines on your network have this + restriction, you must use the + Internet domain name as your NIS domain name. + - - Physical Server Requirements + + Physical Server Requirements There are several things to keep in mind when choosing a machine to use as a NIS server. One of the unfortunate @@ -1457,11 +1484,11 @@ Exports list on foobar: the NIS server becomes unavailable, it will affect all of your NIS clients adversely. - + - NIS Servers + NIS Servers The canonical copies of all NIS information are stored on a single machine called the NIS master server. The @@ -1483,7 +1510,7 @@ Exports list on foobar: database file and transmitting data from the database back to the client. - + Setting Up a NIS Master Server NIS @@ -1496,93 +1523,96 @@ Exports list on foobar: /etc/rc.conf, and FreeBSD will do the rest for you. - - - nisdomainname="test-domain" - This line will set the NIS domainname to - test-domain - upon network setup (e.g., after reboot). - - - nis_server_enable="YES" - This will tell FreeBSD to start up the NIS server processes - when the networking is next brought up. - - - nis_yppasswdd_enable="YES" - This will enable the rpc.yppasswdd - daemon which, as mentioned above, will allow users to - change their NIS password from a client machine. - - + + + nisdomainname="test-domain" + This line will set the NIS domainname to + test-domain + upon network setup (e.g., after reboot). + + + nis_server_enable="YES" + This will tell FreeBSD to start up the NIS server + processes when the networking is next brought + up. + + + nis_yppasswdd_enable="YES" + This will enable the rpc.yppasswdd + daemon which, as mentioned above, will allow users to + change their NIS password from a client + machine. + + - - Depending on your NIS setup, you may need to add - further entries. See the section about NIS - servers that are also NIS clients, below, for - details. - + + Depending on your NIS setup, you may need to add + further entries. See the section about + NIS servers that are also NIS clients, below, for + details. + - After setting up the above entries, run the command - /etc/netstart as superuser. It will - set up everything for you, using the values you defined in - /etc/rc.conf. As a last step, before + After setting up the above entries, run the command + /etc/netstart as superuser. It will + set up everything for you, using the values you defined in + /etc/rc.conf. As a last step, before initializing the NIS maps, start the ypserv daemon manually: &prompt.root; /etc/rc.d/ypserv start - + - - Initializing the NIS Maps - - NIS - maps - - The NIS maps are database files, - that are kept in the /var/yp - directory. They are generated from configuration files in - the /etc directory of the NIS master, - with one exception: the - /etc/master.passwd file. This is for - a good reason, you do not want to propagate passwords to - your root and other administrative - accounts to all the servers in the NIS domain. Therefore, - before we initialize the NIS maps, you should: + + Initializing the NIS Maps + + NIS + maps + + The NIS maps are database files, + that are kept in the /var/yp + directory. They are generated from configuration files in + the /etc directory of the NIS master, + with one exception: the + /etc/master.passwd file. This is for + a good reason, you do not want to propagate passwords to + your root and other administrative + accounts to all the servers in the NIS domain. Therefore, + before we initialize the NIS maps, you should: - &prompt.root; cp /etc/master.passwd /var/yp/master.passwd + &prompt.root; cp /etc/master.passwd /var/yp/master.passwd &prompt.root; cd /var/yp &prompt.root; vi master.passwd - You should remove all entries regarding system - accounts (bin, - tty, kmem, - games, etc), as well as any accounts - that you do not want to be propagated to the NIS clients - (for example root and any other UID 0 - (superuser) accounts). + You should remove all entries regarding system + accounts (bin, + tty, kmem, + games, etc), as well as any accounts + that you do not want to be propagated to the NIS clients + (for example root and any other UID 0 + (superuser) accounts). - Make sure the - /var/yp/master.passwd is neither group - nor world readable (mode 600)! Use the - chmod command, if appropriate. + Make sure the + /var/yp/master.passwd is neither + group nor world readable (mode 600)! Use the + chmod command, if + appropriate. Tru64 UNIX - When you have finished, it is time to initialize the - NIS maps! FreeBSD includes a script named - ypinit to do this for you (see its - manual page for more information). Note that this script - is available on most &unix; Operating Systems, but not on - all. On Digital UNIX/Compaq Tru64 UNIX it is called - ypsetup. Because we are generating - maps for an NIS master, we are going to pass the - option to ypinit. - To generate the NIS maps, assuming you already performed - the steps above, run: + When you have finished, it is time to initialize the + NIS maps! FreeBSD includes a script named + ypinit to do this for you (see its + manual page for more information). Note that this script + is available on most &unix; Operating Systems, but not on + all. On Digital UNIX/Compaq Tru64 UNIX it is called + ypsetup. Because we are generating + maps for an NIS master, we are going to pass the + option to ypinit. + To generate the NIS maps, assuming you already performed + the steps above, run: - ellington&prompt.root; ypinit -m test-domain + ellington&prompt.root; 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. @@ -1606,40 +1636,40 @@ Is this correct? [y/n: y] y NIS Map update completed. ellington has been setup as an YP master server without any errors. - ypinit should have created - /var/yp/Makefile from - /var/yp/Makefile.dist. - When created, this file assumes that you are operating - in a single server NIS environment with only FreeBSD - machines. Since test-domain has - a slave server as well, you must edit - /var/yp/Makefile: + ypinit should have created + /var/yp/Makefile from + /var/yp/Makefile.dist. + When created, this file assumes that you are operating + in a single server NIS environment with only FreeBSD + machines. Since test-domain has + a slave server as well, you must edit + /var/yp/Makefile: - ellington&prompt.root; vi /var/yp/Makefile + ellington&prompt.root; vi /var/yp/Makefile You should comment out the line that says NOPUSH = "True" (if it is not commented out already). - + - + Setting up a NIS Slave Server NIS slave server - Setting up an NIS slave server is even more simple than - setting up the master. Log on to the slave server and edit the - file /etc/rc.conf as you did before. - The only difference is that we now must use the - option when running ypinit. - The option requires the name of the NIS - master be passed to it as well, so our command line looks - like: + Setting up an NIS slave server is even more simple + than setting up the master. Log on to the slave server + and edit the file /etc/rc.conf as you + did before. The only difference is that we now must use + the option when running + ypinit. The option + requires the name of the NIS master be passed to it as + well, so our command line looks like: - coltrane&prompt.root; ypinit -s ellington test-domain + coltrane&prompt.root; ypinit -s ellington test-domain Server Type: SLAVE Domain: test-domain Master: ellington @@ -1697,11 +1727,11 @@ coltrane has been setup as an YP slave server without any errors. Don't forget to update map ypservers on ellington. You should now have a directory called - /var/yp/test-domain. Copies of the NIS - master server's maps should be in this directory. You will - need to make sure that these stay updated. The following - /etc/crontab entries on your slave - servers should do the job: + /var/yp/test-domain. Copies of the + NIS master server's maps should be in this directory. You + will need to make sure that these stay updated. The + following /etc/crontab entries on + your slave servers should do the job: 20 * * * * root /usr/libexec/ypxfr passwd.byname 21 * * * * root /usr/libexec/ypxfr passwd.byuid @@ -1709,93 +1739,96 @@ Don't forget to update map ypservers on ellington. These two lines force the slave to sync its maps with the maps on the master server. These entries are not mandatory because the master server automatically attempts - to push any map changes to its slaves. However, due to the - importance of correct password information on other clients - depending on the slave server, it is recommended to - specifically force the password map updates frequently. This - is especially important on busy networks where map updates - might not always complete. + to push any map changes to its slaves. However, due to + the importance of correct password information on other + clients depending on the slave server, it is recommended + to specifically force the password map updates frequently. + This is especially important on busy networks where map + updates might not always complete. - Now, run the command /etc/netstart on the - slave server as well, which again starts the NIS server. + Now, run the command /etc/netstart + on the slave server as well, which again starts the NIS + server. - NIS Clients + NIS Clients An NIS client establishes what is called a binding to a particular NIS server using the ypbind daemon. ypbind checks the system's default - domain (as set by the domainname command), - and begins broadcasting RPC requests on the local network. - These requests specify the name of the domain for which - ypbind is attempting to establish a binding. - If a server that has been configured to serve the requested - domain receives one of the broadcasts, it will respond to - ypbind, which will record the server's - address. If there are several servers available (a master and - several slaves, for example), ypbind will - use the address of the first one to respond. From that point - on, the client system will direct all of its NIS requests to + domain (as set by the domainname + command), and begins broadcasting RPC requests on the local + network. These requests specify the name of the domain for + which ypbind is attempting to establish a + binding. If a server that has been configured to serve the + requested domain receives one of the broadcasts, it will + respond to ypbind, which will record the + server's address. If there are several servers available (a + master and several slaves, for example), + ypbind will use the address of the first + one to respond. From that point on, the client system will + direct all of its NIS requests to that server. ypbind will - occasionally ping the server to make sure it is - still up and running. If it fails to receive a reply to one of - its pings within a reasonable amount of time, - ypbind will mark the domain as unbound and - begin broadcasting again in the hopes of locating another - server. + occasionally ping the server to make sure it + is still up and running. If it fails to receive a reply to + one of its pings within a reasonable amount of time, + ypbind will mark the domain as unbound + and begin broadcasting again in the hopes of locating + another server. - Setting Up a NIS Client - - NIS - client configuration - - Setting up a FreeBSD machine to be a NIS client is fairly - straightforward. + Setting Up a NIS Client + NIS client + configuration + Setting up a FreeBSD machine to be a NIS + client is fairly straightforward. - Edit the file /etc/rc.conf and - add the following lines in order to set the NIS domainname - and start ypbind upon network - startup: + Edit the file /etc/rc.conf + and add the following lines in order to set the NIS + domainname and start ypbind upon + network startup: nisdomainname="test-domain" nis_client_enable="YES" - To import all possible password entries from the NIS - server, remove all user accounts from your + To import all possible password entries from the + NIS server, remove all user accounts from your /etc/master.passwd file and use vipw to add the following line to - the end of the file: + the end of the file: +::::::::: - This line will afford anyone with a valid account in - the NIS server's password maps an account. There are - many ways to configure your NIS client by changing this - line. See the netgroups - section below for more information. - For more detailed reading see O'Reilly's book on + This line will afford anyone with a valid + account in the NIS server's password maps an + account. There are many ways to configure your NIS + client by changing this line. See the + netgroups + section below for more information. For more + detailed reading see O'Reilly's book on Managing NFS and NIS. - - You should keep at least one local account (i.e. - not imported via NIS) in your - /etc/master.passwd and this - account should also be a member of the group - wheel. If there is something - wrong with NIS, this account can be used to log in - remotely, become root, and fix things. - - + + You should keep at least one local account (i.e. + not imported via NIS) in your + /etc/master.passwd and this + account should also be a member of the group + wheel. If there is something + wrong with NIS, this account can be used to log in + remotely, become root, and fix + things. + + To import all possible group entries from the NIS @@ -1806,17 +1839,16 @@ nis_client_enable="YES" - To start the NIS client immediately, execute the following - commands as the superuser: + To start the NIS client immediately, execute the + following commands as the superuser: &prompt.root; /etc/netstart &prompt.root; /etc/rc.d/ypbind start - After completing these steps, you should be able to run - ypcat passwd and see the NIS server's - passwd map. - - + After completing these steps, you should be able to + run ypcat passwd and see the NIS + server's passwd map. + @@ -1833,12 +1865,12 @@ nis_client_enable="YES" /var/yp/securenets. - This path varies depending on the path specified with the - option. 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 securenets file might look - like this: + This path varies depending on the path specified with + the option. 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 + securenets file might look like this: # allow connections from local host -- mandatory @@ -1860,42 +1892,44 @@ nis_client_enable="YES" host. The ypserv program also has support for - Wietse Venema's TCP Wrapper package. - This allows the administrator to use the + Wietse Venema's TCP Wrapper + package. This allows the administrator to use the TCP Wrapper configuration files for access control instead of /var/yp/securenets. - While both of these access control mechanisms provide some - security, they, like the privileged port test, are - vulnerable to IP spoofing attacks. All - NIS-related traffic should be blocked at your firewall. + While both of these access control mechanisms provide + some security, they, like the privileged port test, are + vulnerable to IP spoofing attacks. All + NIS-related traffic should be blocked at your + firewall. - Servers using /var/yp/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 and/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 the client systems in question or the - abandonment of /var/yp/securenets. + Servers using /var/yp/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 and/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 the client systems in question or the + abandonment of + /var/yp/securenets. - Using /var/yp/securenets on a - server with such an archaic implementation of TCP/IP is a - really bad idea and will lead to loss of NIS functionality - for large parts of your network. + Using /var/yp/securenets on a + server with such an archaic implementation of TCP/IP is a + really bad idea and will lead to loss of NIS functionality + for large parts of your network. TCP Wrappers - The use of the TCP Wrapper - package increases the latency of your NIS server. The - additional delay may be long enough to cause timeouts in - client programs, especially in busy networks or with slow - NIS servers. If one or more of your client systems - suffers from these symptoms, you should convert the client - systems in question into NIS slave servers and force them - to bind to themselves. + The use of the TCP Wrapper + package increases the latency of your NIS server. The + additional delay may be long enough to cause timeouts in + client programs, especially in busy networks or with slow + NIS servers. If one or more of your client systems + suffers from these symptoms, you should convert the client + systems in question into NIS slave servers and force them + to bind to themselves. @@ -1903,28 +1937,28 @@ nis_client_enable="YES" Barring Some Users from Logging On In our lab, there is a machine basie that - is supposed to be a faculty only workstation. We do not want - to take this machine out of the NIS domain, yet the - passwd file on the master NIS server - contains accounts for both faculty and students. What can we - do? + is supposed to be a faculty only workstation. We do not want + to take this machine out of the NIS domain, yet the + passwd file on the master NIS server + contains accounts for both faculty and students. What can we + do? There is a way to bar specific users from logging on to a - machine, even if they are present in the NIS database. To do - this, all you must do is add - -username to the - end of the /etc/master.passwd file on the - client machine, where username is - the username of the user you wish to bar from logging in. - This should preferably be done using vipw, - since vipw will sanity check your changes - to /etc/master.passwd, as well as - automatically rebuild the password database when you finish - editing. For example, if we wanted to bar user - bill from logging on to - basie we would: + machine, even if they are present in the NIS database. To do + this, all you must do is add + -username to the + end of the /etc/master.passwd file on the + client machine, where username is + the username of the user you wish to bar from logging in. + This should preferably be done using vipw, + since vipw will sanity check your changes + to /etc/master.passwd, as well as + automatically rebuild the password database when you finish + editing. For example, if we wanted to bar user + bill from logging on to + basie we would: - basie&prompt.root; vipw + basie&prompt.root; vipw [add -bill to the end, exit] vipw: rebuilding the database... vipw: done @@ -1954,165 +1988,167 @@ basie&prompt.root; - - - Udo - Erdelhoff - Contributed by - - + + + Udo + Erdelhoff + Contributed by + + Using Netgroups netgroups The method shown in the previous section works reasonably - well if you need special rules for a very small number of - users and/or machines. On larger networks, you - will forget to bar some users from logging - onto sensitive machines, or you may even have to modify each - machine separately, thus losing the main benefit of NIS: - centralized administration. + well if you need special rules for a very small number of + users and/or machines. On larger networks, you + will forget to bar some users from + logging onto sensitive machines, or you may even have to + modify each machine separately, thus losing the main benefit + of NIS: centralized + administration. The NIS developers' solution for this problem is called - netgroups. Their purpose and semantics - can be compared to the normal groups used by &unix; file - systems. The main differences are the lack of a numeric ID - and the ability to define a netgroup by including both user - accounts and other netgroups. + netgroups. Their purpose and semantics + can be compared to the normal groups used by &unix; file + systems. The main differences are the lack of a numeric ID + and the ability to define a netgroup by including both user + accounts and other netgroups. Netgroups were developed to handle large, complex networks - with hundreds of users and machines. On one hand, this is - a Good Thing if you are forced to deal with such a situation. - On the other hand, this complexity makes it almost impossible to - explain netgroups with really simple examples. The example - used in the remainder of this section demonstrates this - problem. + with hundreds of users and machines. On one hand, this is a + Good Thing if you are forced to deal with such a situation. + On the other hand, this complexity makes it almost impossible + to explain netgroups with really simple examples. The example + used in the remainder of this section demonstrates this + problem. Let us assume that your successful introduction of NIS in - your laboratory caught your superiors' interest. Your next - job is to extend your NIS domain to cover some of the other - machines on campus. The two tables contain the names of the - new users and new machines as well as brief descriptions of - them. + your laboratory caught your superiors' interest. Your next + job is to extend your NIS domain to cover some of the other + machines on campus. The two tables contain the names of the + new users and new machines as well as brief descriptions of + them. - - - - User Name(s) - Description - - + + + + User Name(s) + Description + + - - - alpha, beta - Normal employees of the IT department - + + + alpha, + beta + Normal employees of the IT department + - - charlie, delta - The new apprentices of the IT department - + + charlie, + delta + The new apprentices of the IT department + - - echo, foxtrott, golf, ... - Ordinary employees - + + echo, + foxtrott, + golf, ... + Ordinary employees + - - able, baker, ... - The current interns - - - + + able, + baker, ... + The current interns + + + - - - - Machine Name(s) - Description - - + + + + Machine Name(s) + Description + + - - - + + + + war, + death, famine, + pollution + Your most important servers. Only the IT + employees are allowed to log onto these + machines. + + + + pride, greed, + envy, wrath, + lust, sloth + Less important servers. All members of the IT + department are allowed to login onto these + machines. + + + one, two, + three, four, + ... + Ordinary workstations. Only the + real employees are allowed to use + these machines. + - war, death, - famine, - pollution - Your most important servers. Only the IT - employees are allowed to log onto these - machines. - - - - - pride, greed, - envy, wrath, - lust, sloth - Less important servers. All members of the IT - department are allowed to login onto these - machines. - - - - one, two, - three, four, - ... - - Ordinary workstations. Only the - real employees are allowed to use - these machines. - - - - trashcan - A very old machine without any critical data. - Even the intern is allowed to use this box. - - - + + trashcan + A very old machine without any critical data. + Even the intern is allowed to use this box. + + + If you tried to implement these restrictions by separately - blocking each user, you would have to add one - -user line to - each system's passwd for each user who is - not allowed to login onto that system. If you forget just one - entry, you could be in trouble. It may be feasible to do this - correctly during the initial setup, however you - will eventually forget to add the lines - for new users during day-to-day operations. After all, Murphy - was an optimist. + blocking each user, you would have to add one + -user line to + each system's passwd for each user who is + not allowed to login onto that system. If you forget just one + entry, you could be in trouble. It may be feasible to do this + correctly during the initial setup, however you + will eventually forget to add the lines + for new users during day-to-day operations. After all, Murphy + was an optimist. Handling this situation with netgroups offers several - advantages. Each user need not be handled separately; you - assign a user to one or more netgroups and allow or forbid - logins for all members of the netgroup. If you add a new - machine, you will only have to define login restrictions for - netgroups. If a new user is added, you will only have to add - the user to one or more netgroups. Those changes are - independent of each other: no more for each combination - of user and machine do... If your NIS setup is planned - carefully, you will only have to modify exactly one central - configuration file to grant or deny access to machines. + advantages. Each user need not be handled separately; you + assign a user to one or more netgroups and allow or forbid + logins for all members of the netgroup. If you add a new + machine, you will only have to define login restrictions for + netgroups. If a new user is added, you will only have to add + the user to one or more netgroups. Those changes are + independent of each other: no more for each combination + of user and machine do... If your NIS setup is planned + carefully, you will only have to modify exactly one central + configuration file to grant or deny access to machines. The first step is the initialization of the NIS map - netgroup. FreeBSD's &man.ypinit.8; does not create this map by - default, but its NIS implementation will support it once it has - been created. To create an empty map, simply type + netgroup. FreeBSD's &man.ypinit.8; does not create this map + by default, but its NIS implementation will support it once it + has been created. To create an empty map, simply type ellington&prompt.root; vi /var/yp/netgroup and start adding content. For our example, we need at - least four netgroups: IT employees, IT apprentices, normal - employees and interns. + least four netgroups: IT employees, IT apprentices, normal + employees and interns. IT_EMP (,alpha,test-domain) (,beta,test-domain) IT_APP (,charlie,test-domain) (,delta,test-domain) @@ -2121,85 +2157,86 @@ USERS (,echo,test-domain) (,foxtrott,test-domain) \ INTERNS (,able,test-domain) (,baker,test-domain) IT_EMP, IT_APP etc. - are the names of the netgroups. Each bracketed group adds - one or more user accounts to it. The three fields inside a - group are: + are the names of the netgroups. Each bracketed group adds + one or more user accounts to it. The three fields inside a + group are: - - The name of the host(s) where the following items are - valid. If you do not specify a hostname, the entry is - valid on all hosts. If you do specify a hostname, you - will enter a realm of darkness, horror and utter confusion. - + + The name of the host(s) where the following items are + valid. If you do not specify a hostname, the entry is + valid on all hosts. If you do specify a hostname, you + will enter a realm of darkness, horror and utter + confusion. + - - The name of the account that belongs to this - netgroup. - + + The name of the account that belongs to this + netgroup. + - - The NIS domain for the account. You can import - accounts from other NIS domains into your netgroup if you - are one of the unlucky fellows with more than one NIS - domain. - + + The NIS domain for the account. You can import + accounts from other NIS domains into your netgroup if you + are one of the unlucky fellows with more than one NIS + domain. + Each of these fields can contain wildcards. See - &man.netgroup.5; for details. + &man.netgroup.5; for details. - netgroups - Netgroup names longer than 8 characters should not be - used, especially if you have machines running other - operating systems within your NIS domain. The names are - case sensitive; using capital letters for your netgroup - names is an easy way to distinguish between user, machine - and netgroup names. + netgroups + Netgroup names longer than 8 characters should not be + used, especially if you have machines running other + operating systems within your NIS domain. The names are + case sensitive; using capital letters for your netgroup + names is an easy way to distinguish between user, machine + and netgroup names. - Some NIS clients (other than FreeBSD) cannot handle - netgroups with a large number of entries. For example, some - older versions of &sunos; start to cause trouble if a netgroup - contains more than 15 entries. You can - circumvent this limit by creating several sub-netgroups with - 15 users or less and a real netgroup that consists of the - sub-netgroups: + Some NIS clients (other than FreeBSD) cannot handle + netgroups with a large number of entries. For example, some + older versions of &sunos; start to cause trouble if a + netgroup contains more than 15 entries. + You can circumvent this limit by creating several + sub-netgroups with 15 users or less and a real netgroup that + consists of the sub-netgroups: - BIGGRP1 (,joe1,domain) (,joe2,domain) (,joe3,domain) [...] + BIGGRP1 (,joe1,domain) (,joe2,domain) (,joe3,domain) [...] BIGGRP2 (,joe16,domain) (,joe17,domain) [...] BIGGRP3 (,joe31,domain) (,joe32,domain) BIGGROUP BIGGRP1 BIGGRP2 BIGGRP3 - You can repeat this process if you need more than 225 - users within a single netgroup. + You can repeat this process if you need more than 225 + users within a single netgroup. Activating and distributing your new NIS map is - easy: + easy: ellington&prompt.root; cd /var/yp ellington&prompt.root; make This will generate the three NIS maps - netgroup, - netgroup.byhost and - netgroup.byuser. Use &man.ypcat.1; to - check if your new NIS maps are available: + netgroup, + netgroup.byhost and + netgroup.byuser. Use &man.ypcat.1; to + check if your new NIS maps are available: ellington&prompt.user; ypcat -k netgroup ellington&prompt.user; ypcat -k netgroup.byhost ellington&prompt.user; ypcat -k netgroup.byuser The output of the first command should resemble the - contents of /var/yp/netgroup. The second - command will not produce output if you have not specified - host-specific netgroups. The third command can be used to - get the list of netgroups for a user. + contents of /var/yp/netgroup. The second + command will not produce output if you have not specified + host-specific netgroups. The third command can be used to + get the list of netgroups for a user. The client setup is quite simple. To configure the server - war, you only have to start - &man.vipw.8; and replace the line + war, you only have to start + &man.vipw.8; and replace the line +::::::::: @@ -2208,9 +2245,9 @@ ellington&prompt.user; ypcat -k netgroup.byuser +@IT_EMP::::::::: Now, only the data for the users defined in the netgroup - IT_EMP is imported into - war's password database and only - these users are allowed to login. + IT_EMP is imported into + war's password database and only + these users are allowed to login. Unfortunately, this limitation also applies to the ~ function of the shell and all routines @@ -2222,100 +2259,101 @@ ellington&prompt.user; ypcat -k netgroup.byuser will fail with No such user. To fix this, you will have to import all user entries without allowing them to login onto your - servers. + servers. This can be achieved by adding another line to - /etc/master.passwd. This line should - contain: + /etc/master.passwd. This line should + contain: +:::::::::/sbin/nologin, meaning - Import all entries but replace the shell with - /sbin/nologin in the imported - entries. You can replace any field in the - passwd entry by placing a default value in - your /etc/master.passwd. + Import all entries but replace the shell with + /sbin/nologin in the imported + entries. You can replace any field in the + passwd entry by placing a default value in + your /etc/master.passwd. - Make sure that the line - +:::::::::/sbin/nologin is placed after - +@IT_EMP:::::::::. Otherwise, all user - accounts imported from NIS will have /sbin/nologin as their - login shell. + Make sure that the line + +:::::::::/sbin/nologin is placed after + +@IT_EMP:::::::::. Otherwise, all user + accounts imported from NIS will have + /sbin/nologin as their login + shell. After this change, you will only have to change one NIS - map if a new employee joins the IT department. You could use - a similar approach for the less important servers by replacing - the old +::::::::: in their local version - of /etc/master.passwd with something like - this: + map if a new employee joins the IT department. You could use + a similar approach for the less important servers by replacing + the old +::::::::: in their local version + of /etc/master.passwd with something like + this: +@IT_EMP::::::::: +@IT_APP::::::::: +:::::::::/sbin/nologin The corresponding lines for the normal workstations - could be: + could be: +@IT_EMP::::::::: +@USERS::::::::: +:::::::::/sbin/nologin And everything would be fine until there is a policy - change a few weeks later: The IT department starts hiring - interns. The IT interns are allowed to use the normal - workstations and the less important servers; and the IT - apprentices are allowed to login onto the main servers. You - add a new netgroup IT_INTERN, add the new - IT interns to this netgroup and start to change the - configuration on each and every machine... As the old saying - goes: Errors in centralized planning lead to global - mess. + change a few weeks later: The IT department starts hiring + interns. The IT interns are allowed to use the normal + workstations and the less important servers; and the IT + apprentices are allowed to login onto the main servers. You + add a new netgroup IT_INTERN, add the new + IT interns to this netgroup and start to change the + configuration on each and every machine... As the old saying + goes: Errors in centralized planning lead to global + mess. NIS' ability to create netgroups from other netgroups can - be used to prevent situations like these. One possibility - is the creation of role-based netgroups. For example, you - could create a netgroup called - BIGSRV to define the login - restrictions for the important servers, another netgroup - called SMALLSRV for the less - important servers and a third netgroup called - USERBOX for the normal - workstations. Each of these netgroups contains the netgroups - that are allowed to login onto these machines. The new - entries for your NIS map netgroup should look like this: + be used to prevent situations like these. One possibility is + the creation of role-based netgroups. For example, you could + create a netgroup called BIGSRV to define + the login restrictions for the important servers, another + netgroup called SMALLSRV for the less + important servers and a third netgroup called + USERBOX for the normal + workstations. Each of these netgroups contains the netgroups + that are allowed to login onto these machines. The new + entries for your NIS map netgroup should look like + this: BIGSRV IT_EMP IT_APP SMALLSRV IT_EMP IT_APP ITINTERN USERBOX IT_EMP ITINTERN USERS This method of defining login restrictions works - reasonably well if you can define groups of machines with - identical restrictions. Unfortunately, this is the exception - and not the rule. Most of the time, you will need the ability - to define login restrictions on a per-machine basis. + reasonably well if you can define groups of machines with + identical restrictions. Unfortunately, this is the exception + and not the rule. Most of the time, you will need the ability + to define login restrictions on a per-machine basis. Machine-specific netgroup definitions are the other - possibility to deal with the policy change outlined above. In - this scenario, the /etc/master.passwd of - each box contains two lines starting with +. - The first of them adds a netgroup with the accounts allowed to - login onto this machine, the second one adds all other - accounts with /sbin/nologin as shell. It - is a good idea to use the ALL-CAPS version of - the machine name as the name of the netgroup. In other words, - the lines should look like this: + possibility to deal with the policy change outlined above. In + this scenario, the /etc/master.passwd of + each box contains two lines starting with +. + The first of them adds a netgroup with the accounts allowed to + login onto this machine, the second one adds all other + accounts with /sbin/nologin as shell. It + is a good idea to use the ALL-CAPS version of + the machine name as the name of the netgroup. In other words, + the lines should look like this: +@BOXNAME::::::::: +:::::::::/sbin/nologin Once you have completed this task for all your machines, - you will not have to modify the local versions of - /etc/master.passwd ever again. All - further changes can be handled by modifying the NIS map. Here - is an example of a possible netgroup map for this - scenario with some additional goodies: + you will not have to modify the local versions of + /etc/master.passwd ever again. All + further changes can be handled by modifying the NIS map. Here + is an example of a possible netgroup map for this + scenario with some additional goodies: # Define groups of users first IT_EMP (,alpha,test-domain) (,beta,test-domain) @@ -2354,60 +2392,61 @@ TWO (,hotel,test-domain) # [...more groups to follow] If you are using some kind of database to manage your user - accounts, you should be able to create the first part of the - map with your database's report tools. This way, new users - will automatically have access to the boxes. + accounts, you should be able to create the first part of the + map with your database's report tools. This way, new users + will automatically have access to the boxes. One last word of caution: It may not always be advisable - to use machine-based netgroups. If you are deploying a couple of - dozen or even hundreds of identical machines for student labs, - you should use role-based netgroups instead of machine-based - netgroups to keep the size of the NIS map within reasonable - limits. + to use machine-based netgroups. If you are deploying a couple + of dozen or even hundreds of identical machines for student + labs, you should use role-based netgroups instead of + machine-based netgroups to keep the size of the NIS map within + reasonable limits. Important Things to Remember - There are still a couple of things that you will need to do - differently now that you are in an NIS environment. + There are still a couple of things that you will need to + do differently now that you are in an NIS environment. - - Every time you wish to add a user to the lab, you - must add it to the master NIS server only, - and you must remember to rebuild the NIS - maps. If you forget to do this, the new user will - not be able to login anywhere except on the NIS master. - For example, if we needed to add a new user - jsmith to the lab, we would: + + Every time you wish to add a user to the lab, you + must add it to the master NIS server + only, and you must remember + to rebuild the NIS maps. If you forget to do + this, the new user will not be able to login anywhere + except on the NIS master. For example, if we needed to + add a new user jsmith to the lab, we + would: - &prompt.root; pw useradd jsmith + &prompt.root; pw useradd jsmith &prompt.root; cd /var/yp &prompt.root; make test-domain - You could also run adduser jsmith instead - of pw useradd jsmith. - - - Keep the administration accounts out of the - NIS maps. You do not want to be propagating - administrative accounts and passwords to machines that - will have users that should not have access to those - accounts. - - - Keep the NIS master and slave secure, and - minimize their downtime. If somebody either - hacks or simply turns off these machines, they have - effectively rendered many people without the ability to - login to the lab. + You could also run adduser jsmith + instead of pw useradd jsmith. - This is the chief weakness of any centralized administration - system. If you do - not protect your NIS servers, you will have a lot of angry - users! - + + + Keep the administration accounts out of the + NIS maps. You do not want to be propagating + administrative accounts and passwords to machines that + will have users that should not have access to those + accounts. + + + Keep the NIS master and slave secure, and + minimize their downtime. If somebody either + hacks or simply turns off these machines, they have + effectively rendered many people without the ability to + login to the lab. + + This is the chief weakness of any centralized + administration system. If you do not protect your NIS + servers, you will have a lot of angry users! + @@ -2448,13 +2487,13 @@ TWO (,hotel,test-domain) present since the servers might bind to each other all over again. - You can force a host to bind to a particular server by running - ypbind with the + You can force a host to bind to a particular server by + running ypbind with the flag. If you do not want to do this manually each time you - reboot your NIS server, you can add the following lines to - your /etc/rc.conf: + reboot your NIS server, you can add the following lines to + your /etc/rc.conf: - nis_client_enable="YES" # run client stuff as well + nis_client_enable="YES" # run client stuff as well nis_client_flags="-S NIS domain,server" See &man.ypbind.8; for further information. @@ -2463,29 +2502,31 @@ nis_client_flags="-S NIS domain,server Password Formats - NIS + NIS password formats - One of the most common issues that people run into when trying - to implement NIS is password format compatibility. If your NIS - server is using DES encrypted passwords, it will only support - clients that are also using DES. For example, if you have - &solaris; NIS clients in your network, then you will almost certainly - need to use DES encrypted passwords. + One of the most common issues that people run into when + trying to implement NIS is password format compatibility. If + your NIS server is using DES encrypted passwords, it will only + support clients that are also using DES. For example, if you + have &solaris; NIS clients in your network, then you will + almost certainly need to use DES encrypted passwords. - To check which format your servers - and clients are using, look at /etc/login.conf. - If the host is configured to use DES encrypted passwords, then the - default class will contain an entry like this: + To check which format your servers and clients are using, + look at /etc/login.conf. If the host is + configured to use DES encrypted passwords, then the + default class will contain an entry like + this: default:\ :passwd_format=des:\ :copyright=/etc/COPYRIGHT:\ [Further entries elided] - Other possible values for the passwd_format - capability include blf and md5 - (for Blowfish and MD5 encrypted passwords, respectively). + Other possible values for the + passwd_format capability include + blf and md5 (for + Blowfish and MD5 encrypted passwords, respectively). If you have made changes to /etc/login.conf, you will also need to @@ -2525,11 +2566,11 @@ nis_client_flags="-S NIS domain,server - - Greg - Sutter + + Greg + Sutter Written by - + Automatic Network Configuration (DHCP) @@ -2537,35 +2578,35 @@ nis_client_flags="-S NIS domain,server What Is DHCP? - Dynamic Host Configuration Protocol - DHCP + Dynamic Host Configuration Protocol + DHCP - Internet Systems Consortium (ISC) + Internet Systems Consortium (ISC) DHCP, the Dynamic Host Configuration Protocol, describes - the means by which a system can connect to a network and obtain the - necessary information for communication upon that network. FreeBSD - uses the OpenBSD dhclient - taken from OpenBSD 3.7. All - information here regarding dhclient is for - use with either of the ISC or OpenBSD DHCP clients. The DHCP - server is the one included in the ISC distribution. + the means by which a system can connect to a network and + obtain the necessary information for communication upon that + network. FreeBSD uses the OpenBSD dhclient + taken from OpenBSD 3.7. All information here regarding + dhclient is for use with either of the ISC + or OpenBSD DHCP clients. The DHCP server is the one included + in the ISC distribution. What This Section Covers - This section describes both the client-side components of the ISC and OpenBSD DHCP client and - server-side components of the ISC DHCP system. The - client-side program, dhclient, comes - integrated within FreeBSD, and the server-side portion is - available from the net/isc-dhcp42-server port. The - &man.dhclient.8;, &man.dhcp-options.5;, and - &man.dhclient.conf.5; manual pages, in addition to the - references below, are useful resources. + This section describes both the client-side components of + the ISC and OpenBSD DHCP client and server-side components of + the ISC DHCP system. The client-side program, + dhclient, comes integrated within FreeBSD, + and the server-side portion is available from the net/isc-dhcp42-server port. The + &man.dhclient.8;, &man.dhcp-options.5;, and + &man.dhclient.conf.5; manual pages, in addition to the + references below, are useful resources. @@ -2584,41 +2625,40 @@ nis_client_flags="-S NIS domain,server DHCP clients can obtain a great deal of information from - the server. An exhaustive list may be found in - &man.dhcp-options.5;. + the server. An exhaustive list may be found in + &man.dhcp-options.5;. FreeBSD Integration &os; fully integrates the OpenBSD DHCP client, - dhclient. DHCP client support is provided - within both the installer and the base system, obviating the need - for detailed knowledge of network configurations on any network - that runs a DHCP server. - - sysinstall - + dhclient. DHCP client support is provided + within both the installer and the base system, obviating the + need for detailed knowledge of network configurations on any + network that runs a DHCP server. + sysinstall + - DHCP is supported by - sysinstall. When configuring a - network interface within - sysinstall, the second question - asked is: Do you want to try DHCP configuration of - the interface?. Answering affirmatively will - execute dhclient, and if successful, will - fill in the network configuration information - automatically. + DHCP is supported by + sysinstall. When configuring a + network interface within + sysinstall, the second question + asked is: Do you want to try DHCP configuration of + the interface?. Answering affirmatively will + execute dhclient, and if successful, will + fill in the network configuration information + automatically. - There are two things you must do to have your system use + There are two things you must do to have your system use DHCP upon startup: - - DHCP - requirements - + + DHCP + requirements + - Make sure that the bpf + Make sure that the bpf device is compiled into your kernel. To do this, add device bpf to your kernel configuration file, and rebuild the kernel. For more @@ -2631,18 +2671,19 @@ nis_client_flags="-S NIS domain,server For those who are particularly security conscious, - you should be warned that bpf + you should be warned that bpf is also the device that allows packet sniffers to work correctly (although they still have to be run as - root). bpf - is required to use DHCP, but if - you are very sensitive about security, you probably - should not add bpf to your + root). + bpf is + required to use DHCP, but if you are very sensitive + about security, you probably should not add + bpf to your kernel in the expectation that at some point in the future you will be using DHCP. - + By default, DHCP configuration on &os; runs in the background, or asynchronously. Other startup scripts continue to run while DHCP @@ -2650,12 +2691,12 @@ nis_client_flags="-S NIS domain,serverBackground DHCP works well when the DHCP server responds quickly to requests and the DHCP configuration - process goes quickly. However, DHCP may take a long time - to complete on some systems. If network services attempt - to run before DHCP has completed, they will fail. Using - DHCP in synchronous mode prevents - the problem, pausing startup until DHCP configuration has - completed. + process goes quickly. However, DHCP may take a long + time to complete on some systems. If network services + attempt to run before DHCP has completed, they will + fail. Using DHCP in synchronous + mode prevents the problem, pausing startup until DHCP + configuration has completed. To connect to a DHCP server in the background while other startup continues (asynchronous mode), use the @@ -2664,157 +2705,164 @@ nis_client_flags="-S NIS domain,serverifconfig_fxp0="DHCP" - To pause startup while DHCP completes, use synchronous - mode with the SYNCDHCP - value: + To pause startup while DHCP completes, use + synchronous mode with the + SYNCDHCP value: ifconfig_fxp0="SYNCDHCP" - - Replace the fxp0 shown in - these examples with the name of the interface to be + + Replace the fxp0 shown + in these examples with the name of the interface to be dynamically configured, as described in - . - + . + - If you are using a different location for - dhclient, or if you wish to pass additional - flags to dhclient, also include - (editing as necessary): + If you are using a different location for + dhclient, or if you wish to pass + additional flags to dhclient, also + include (editing as necessary): - dhclient_program="/sbin/dhclient" + dhclient_program="/sbin/dhclient" dhclient_flags="" - - + + - - DHCP - server - - The DHCP server, dhcpd, is included - as part of the net/isc-dhcp42-server port in the ports - collection. This port contains the ISC DHCP server and - documentation. + + DHCP + server + + The DHCP server, dhcpd, is + included as part of the net/isc-dhcp42-server port in + the ports collection. This port contains the ISC DHCP + server and documentation. Files - DHCP - configuration files + DHCP + configuration files - /etc/dhclient.conf - dhclient requires a configuration file, - /etc/dhclient.conf. Typically the file - contains only comments, the defaults being reasonably sane. This - configuration file is described by the &man.dhclient.conf.5; - manual page. - + + /etc/dhclient.conf + dhclient requires a configuration + file, /etc/dhclient.conf. Typically + the file contains only comments, the defaults being + reasonably sane. This configuration file is described by + the &man.dhclient.conf.5; + manual page. + - /sbin/dhclient - dhclient is statically linked and - resides in /sbin. The &man.dhclient.8; - manual page gives more information about - dhclient. - + + /sbin/dhclient + dhclient is statically linked and + resides in /sbin. The + &man.dhclient.8; manual page gives more information about + dhclient. + - /sbin/dhclient-script - dhclient-script is the FreeBSD-specific - DHCP client configuration script. It is described in - &man.dhclient-script.8;, but should not need any user - modification to function properly. - + + /sbin/dhclient-script + dhclient-script is the + FreeBSD-specific DHCP client configuration script. It is + described in &man.dhclient-script.8;, but should not need + any user modification to function properly. + - /var/db/dhclient.leases - The DHCP client keeps a database of valid leases in this - file, which is written as a log. &man.dhclient.leases.5; - gives a slightly longer description. - + + /var/db/dhclient.leases + The DHCP client keeps a database of valid leases in + this file, which is written as a log. + &man.dhclient.leases.5; gives a slightly longer + description. + Further Reading - The DHCP protocol is fully described in - RFC 2131. - An informational resource has also been set up at - . + The DHCP protocol is fully described in RFC + 2131. An informational resource has also been set up + at . - Installing and Configuring a DHCP Server + Installing and Configuring a DHCP Server - - What This Section Covers + + What This Section Covers - This section provides information on how to configure - a FreeBSD system to act as a DHCP server using the ISC - (Internet Systems Consortium) implementation of the DHCP - server. + This section provides information on how to configure + a FreeBSD system to act as a DHCP server using the ISC + (Internet Systems Consortium) implementation of the DHCP + server. - The server is not provided as part of - FreeBSD, and so you will need to install the - net/isc-dhcp42-server - port to provide this service. See for - more information on using the Ports Collection. - + The server is not provided as part of FreeBSD, and so + you will need to install the net/isc-dhcp42-server port to + provide this service. See for + more information on using the Ports Collection. + - - DHCP Server Installation - - DHCP - installation - - In order to configure your FreeBSD system as a DHCP - server, you will need to ensure that the &man.bpf.4; - device is compiled into your kernel. To do this, add - device bpf to your kernel - configuration file, and rebuild the kernel. For more - information about building kernels, see + DHCP Server Installation + + DHCP + installation + + In order to configure your FreeBSD system as a DHCP + server, you will need to ensure that the &man.bpf.4; + device is compiled into your kernel. To do this, add + device bpf to your kernel + configuration file, and rebuild the kernel. For more + information about building kernels, see . - The bpf device is already - part of the GENERIC kernel that is - supplied with FreeBSD, so you do not need to create a custom - kernel in order to get DHCP working. + The bpf device is already + part of the GENERIC kernel that is + supplied with FreeBSD, so you do not need to create a + custom kernel in order to get DHCP working. - - Those who are particularly security conscious - should note that bpf - is also the device that allows packet sniffers to work - correctly (although such programs still need privileged - access). bpf - is required to use DHCP, but if - you are very sensitive about security, you probably - should not include bpf in your - kernel purely because you expect to use DHCP at some - point in the future. - + + Those who are particularly security conscious + should note that bpf is also + the device that allows packet sniffers to work + correctly (although such programs still need + privileged access). bpf + is required to use DHCP, but if + you are very sensitive about security, you probably + should not include bpf in + your kernel purely because you expect to use DHCP at + some point in the future. + - The next thing that you will need to do is edit the sample - dhcpd.conf which was installed by the - net/isc-dhcp42-server port. - By default, this will be - /usr/local/etc/dhcpd.conf.sample, and you - should copy this to - /usr/local/etc/dhcpd.conf before proceeding - to make changes. - + The next thing that you will need to do is edit the + sample dhcpd.conf which was installed + by the net/isc-dhcp42-server port. + By default, this will be + /usr/local/etc/dhcpd.conf.sample, and + you should copy this to + /usr/local/etc/dhcpd.conf before + proceeding to make changes. + - - Configuring the DHCP Server - - DHCP - dhcpd.conf - - dhcpd.conf is - comprised of declarations regarding subnets and hosts, and is - perhaps most easily explained using an example : + + Configuring the DHCP Server + + DHCP + dhcpd.conf + + dhcpd.conf is comprised of + declarations regarding subnets and hosts, and is perhaps + most easily explained using an example : - option domain-name "example.com"; + option domain-name "example.com"; option domain-name-servers 192.168.4.100; option subnet-mask 255.255.255.0; @@ -2832,153 +2880,165 @@ host mailhost { fixed-address mailhost.example.com; } - - - This option specifies the domain that will be provided - to clients as the default search domain. See - &man.resolv.conf.5; for more information on what this - means. - + + + This option specifies the domain that will be + provided to clients as the default search domain. See + &man.resolv.conf.5; for more information on what this + means. + - - This option specifies a comma separated list of DNS - servers that the client should use. - + + This option specifies a comma separated list of + DNS servers that the client should use. + - - The netmask that will be provided to clients. - + + The netmask that will be provided to + clients. + - - A client may request a specific length of time that a - lease will be valid. Otherwise the server will assign - a lease with this expiry value (in seconds). - + + A client may request a specific length of time + that a lease will be valid. Otherwise the server will + assign a lease with this expiry value (in + seconds). + - - This is the maximum length of time that the server will - lease for. Should a client request a longer lease, a lease - will be issued, although it will only be valid for - max-lease-time seconds. - + + This is the maximum length of time that the server + will lease for. Should a client request a longer + lease, a lease will be issued, although it will only + be valid for max-lease-time + seconds. + - - This option specifies whether the DHCP server should - attempt to update DNS when a lease is accepted or released. - In the ISC implementation, this option is - required. - + + This option specifies whether the DHCP server + should attempt to update DNS when a lease is accepted + or released. In the ISC implementation, this option + is required. + - - This denotes which IP addresses should be used in - the pool reserved for allocating to clients. IP - addresses between, and including, the ones stated are - handed out to clients. - + + This denotes which IP addresses should be used in + the pool reserved for allocating to clients. IP + addresses between, and including, the ones stated are + handed out to clients. + - - Declares the default gateway that will be provided to - clients. - + + Declares the default gateway that will be provided + to clients. + - - The hardware MAC address of a host (so that the DHCP server - can recognize a host when it makes a request). - + + The hardware MAC address of a host (so that the + DHCP server can recognize a host when it makes a + request). + - - Specifies that the host should always be given the - same IP address. Note that using a hostname is - correct here, since the DHCP server will resolve the - hostname itself before returning the lease - information. - - + + Specifies that the host should always be given the + same IP address. Note that using a hostname is + correct here, since the DHCP server will resolve the + hostname itself before returning the lease + information. + + - Once you have finished writing your - dhcpd.conf, - you should enable the DHCP server in - /etc/rc.conf, i.e., by adding: + Once you have finished writing your + dhcpd.conf, + you should enable the DHCP server in + /etc/rc.conf, i.e., by adding: - dhcpd_enable="YES" + dhcpd_enable="YES" dhcpd_ifaces="dc0" - Replace the dc0 interface name with the - interface (or interfaces, separated by whitespace) that your DHCP - server should listen on for DHCP client requests. + Replace the dc0 interface name with + the interface (or interfaces, separated by whitespace) + that your DHCP server should listen on for DHCP client + requests. - Then, you can proceed to start the server by issuing the - following command: + Then, you can proceed to start the server by issuing + the following command: - &prompt.root; /usr/local/etc/rc.d/isc-dhcpd start + &prompt.root; /usr/local/etc/rc.d/isc-dhcpd start - Should you need to make changes to the configuration of your - server in the future, it is important to note that sending a - SIGHUP signal to - dhcpd does not - result in the configuration being reloaded, as it does with most - daemons. You will need to send a SIGTERM - signal to stop the process, and then restart it using the command - above. - + Should you need to make changes to the configuration + of your server in the future, it is important to note that + sending a SIGHUP signal to + dhcpd does + not result in the configuration being + reloaded, as it does with most daemons. You will need to + send a SIGTERM signal to stop the + process, and then restart it using the command + above. + - - Files - - DHCP - configuration files - - - /usr/local/sbin/dhcpd - dhcpd is statically linked and - resides in /usr/local/sbin. The - &man.dhcpd.8; manual page installed with the - port gives more information about - dhcpd. - + + Files + + DHCP + configuration files + + + + /usr/local/sbin/dhcpd + dhcpd is statically + linked and resides in + /usr/local/sbin. The + &man.dhcpd.8; manual page installed with the port + gives more information about + dhcpd. + - /usr/local/etc/dhcpd.conf - dhcpd requires a configuration - file, /usr/local/etc/dhcpd.conf before it - will start providing service to clients. This file needs to - contain all the information that should be provided to clients - that are being serviced, along with information regarding the - operation of the server. This configuration file is described - by the &man.dhcpd.conf.5; manual page installed - by the port. - + + /usr/local/etc/dhcpd.conf + dhcpd requires a + configuration file, + /usr/local/etc/dhcpd.conf before + it will start providing service to clients. This file + needs to contain all the information that should be + provided to clients that are being serviced, along + with information regarding the operation of the + server. This configuration file is described + by the &man.dhcpd.conf.5; manual page installed + by the port. + - /var/db/dhcpd.leases - The DHCP server keeps a database of leases it has issued - in this file, which is written as a log. The manual page - &man.dhcpd.leases.5;, installed by the port - gives a slightly longer description. - - - /usr/local/sbin/dhcrelay - dhcrelay is used in advanced - environments where one DHCP server forwards a request from a - client to another DHCP server on a separate network. If you - require this functionality, then install the net/isc-dhcp42-relay port. The - &man.dhcrelay.8; manual page provided with the - port contains more detail. - - - - - + + /var/db/dhcpd.leases + The DHCP server keeps a database of leases it has + issued in this file, which is written as a log. The + manual page &man.dhcpd.leases.5;, installed by the + port gives a slightly longer description. + + + /usr/local/sbin/dhcrelay + dhcrelay is used in + advanced environments where one DHCP server forwards a + request from a client to another DHCP server on a + separate network. If you require this functionality, + then install the net/isc-dhcp42-relay port. + The &man.dhcrelay.8; manual page provided with the + port contains more detail. + + + + - - Chern - Lee - Contributed by - + + Chern + Lee + Contributed by + Tom @@ -2999,23 +3059,26 @@ dhcpd_ifaces="dc0" &os; utilizes, by default, a version of BIND (Berkeley Internet Name Domain), which is the most common implementation - of the DNS protocol. DNS - is the protocol through which names are mapped to - IP addresses, and vice versa. For example, a - query for www.FreeBSD.org will - receive a reply with the IP address of The - &os; Project's web server, whereas, a query for ftp.FreeBSD.org will return the + of the DNS protocol. + DNS is the protocol through which names are + mapped to IP addresses, and vice versa. + For example, a query for www.FreeBSD.org will receive a reply + with the IP address of The &os; Project's + web server, whereas, a query for ftp.FreeBSD.org will return the IP address of the corresponding FTP machine. Likewise, the opposite can happen. A query for an IP address can - resolve its hostname. It is not necessary to run a name server - to perform DNS lookups on a system. + resolve its hostname. It is not necessary to run a name + server to perform DNS lookups on a + system. &os; currently comes with BIND9 DNS server software by default. Our installation provides enhanced security features, a new file - system layout and automated &man.chroot.8; configuration. + system layout and automated &man.chroot.8; + configuration. DNS DNS is coordinated across the Internet @@ -3065,14 +3128,14 @@ dhcpd_ifaces="dc0" named, BIND - Common names for the BIND name server package within - &os;. + Common names for the BIND name server package + within &os;. Resolver - A system process through which a - machine queries a name server for zone information. + A system process through which a machine queries + a name server for zone information. @@ -3092,8 +3155,8 @@ dhcpd_ifaces="dc0" Zone - An individual domain, subdomain, or portion of the - DNS administered by the same + An individual domain, subdomain, or portion of + the DNS administered by the same authority. @@ -3132,11 +3195,12 @@ dhcpd_ifaces="dc0" - As one can see, the more specific part of a hostname appears - to its left. For example, example.org. is more specific than - org., as org. is more specific - than the root zone. The layout of each part of a hostname is + As one can see, the more specific part of a hostname + appears to its left. For example, example.org. is more specific + than org., as org. is more + specific than the root zone. The layout of each part of a + hostname is much like a file system: the /dev directory falls within the root, and so on. @@ -3153,21 +3217,21 @@ dhcpd_ifaces="dc0" - One wants to serve DNS information to - the world, replying authoritatively to queries. + One wants to serve DNS information + to the world, replying authoritatively to queries. A domain, such as example.org, is registered and - IP addresses need to be assigned to - hostnames under it. + role="domainname">example.org, is registered + and IP addresses need to be assigned + to hostnames under it. - An IP address block requires reverse - DNS entries (IP to - hostname). + An IP address block requires + reverse DNS entries + (IP to hostname). @@ -3187,13 +3251,14 @@ dhcpd_ifaces="dc0" When one queries for www.FreeBSD.org, the resolver usually + role="fqdn">www.FreeBSD.org, the resolver usually queries the uplink ISP's name server, and retrieves the reply. With a local, caching DNS server, the query only has to be made - once to the outside world by the caching DNS - server. Additional queries will not have to go - outside the local network, since the information is cached + once to the outside world by the caching + DNS server. Additional queries will not + have to go outside the local network, since the information is + cached locally. @@ -3223,8 +3288,10 @@ dhcpd_ifaces="dc0" - /etc/namedb - Directory where BIND zone information resides. + /etc/namedb + Directory where BIND zone information + resides. @@ -3237,12 +3304,13 @@ dhcpd_ifaces="dc0" Depending on how a given zone is configured on the server, the files related to that zone can be found in the master, slave, or dynamic subdirectories of the + class="directory">master, slave, or dynamic subdirectories of the /etc/namedb directory. - These files contain the DNS information that - will be given out by the name server in response to queries. + These files contain the DNS information + that will be given out by the name server in response to + queries. @@ -3266,20 +3334,21 @@ dhcpd_ifaces="dc0" &prompt.root; /etc/rc.d/named onestart To ensure the named daemon is - started at boot each time, put the following line into the - /etc/rc.conf: + started at boot each time, put the following line into the + /etc/rc.conf: named_enable="YES" There are obviously many configuration options for - /etc/namedb/named.conf that are beyond the - scope of this document. However, if you are interested in the - startup options for named on &os;, - take a look at the + /etc/namedb/named.conf that are beyond + the scope of this document. However, if you are interested in + the startup options for named on + &os;, take a look at the named_* flags in /etc/defaults/rc.conf and consult the - &man.rc.conf.5; manual page. The - section is also a good read. + &man.rc.conf.5; manual page. The section is also a good + read. @@ -3291,10 +3360,10 @@ dhcpd_ifaces="dc0" Configuration files for named - currently reside in - /etc/namedb directory and - will need modification before use unless all that is needed is - a simple resolver. This is where most of the configuration will + currently reside in /etc/namedb directory and will + need modification before use unless all that is needed is a + simple resolver. This is where most of the configuration will be performed. @@ -3360,11 +3429,11 @@ options { cache, forwarders can be enabled here. Under normal circumstances, a name server will recursively query the Internet looking at certain name servers until it - finds the answer it is looking for. Having this enabled will - have it query the uplink's name server (or name server - provided) first, taking advantage of its cache. If the uplink - name server in question is a heavily trafficked, fast name - server, enabling this may be worthwhile. + finds the answer it is looking for. Having this enabled + will have it query the uplink's name server (or name server + provided) first, taking advantage of its cache. If the + uplink name server in question is a heavily trafficked, fast + name server, enabling this may be worthwhile. 127.0.0.1 will @@ -3612,8 +3681,8 @@ zone "1.168.192.in-addr.arpa" { }; */ - In named.conf, these are examples of - slave entries for a forward and reverse zone. + In named.conf, these are examples + of slave entries for a forward and reverse zone. For each new zone served, a new zone entry must be added to named.conf. @@ -3628,8 +3697,9 @@ zone "1.168.192.in-addr.arpa" { }; The zone is a master, as indicated by the - statement, holding its zone information - in /etc/namedb/master/example.org + statement, holding its zone + information in + /etc/namedb/master/example.org indicated by the statement. zone "example.org" { @@ -3638,9 +3708,9 @@ zone "1.168.192.in-addr.arpa" { }; In the slave case, the zone information is transferred - from the master name server for the particular zone, and saved - in the file specified. If and when the master server dies or - is unreachable, the slave name server will have the + from the master name server for the particular zone, and + saved in the file specified. If and when the master server + dies or is unreachable, the slave name server will have the transferred zone information and will be able to serve it. @@ -3653,7 +3723,7 @@ zone "1.168.192.in-addr.arpa" { An example master zone file for example.org (existing within + role="domainname">example.org (existing within /etc/namedb/master/example.org) is as follows: @@ -3686,22 +3756,22 @@ mail IN A 192.168.1.5 ; Aliases www IN CNAME example.org. - Note that every hostname ending in a . is an - exact hostname, whereas everything without a trailing - . is relative to the origin. For example, - ns1 is translated into - ns1.example.org. + Note that every hostname ending in a . is + an exact hostname, whereas everything without a trailing + . is relative to the origin. For example, + ns1 is translated into + ns1.example.org. - The format of a zone file follows: + The format of a zone file follows: - recordname IN recordtype value + recordname IN recordtype value DNS records - The most commonly used DNS records: + The most commonly used DNS records: @@ -3713,8 +3783,9 @@ www IN CNAME example.org. NS - an authoritative name server - + + an authoritative name server + A @@ -3725,7 +3796,8 @@ www IN CNAME example.org. CNAME - the canonical name for an alias + the canonical name for an + alias @@ -3737,12 +3809,14 @@ www IN CNAME example.org. PTR - a domain name pointer (used in reverse DNS) - + + a domain name pointer (used in reverse + DNS) + - example.org. IN SOA ns1.example.org. admin.example.org. ( + example.org. IN SOA ns1.example.org. admin.example.org. ( 2006051501 ; Serial 10800 ; Refresh after 3 hours 3600 ; Retry after 1 hour @@ -3751,7 +3825,8 @@ www IN CNAME example.org. - example.org. + example.org. the domain name, also the origin for this @@ -3797,62 +3872,64 @@ www IN CNAME example.org. - IN NS ns1.example.org. + IN NS ns1.example.org. - This is an NS entry. Every name server that is going to reply - authoritatively for the zone must have one of these entries. + This is an NS entry. Every name server that is going to + reply authoritatively for the zone must have one of these + entries. - localhost IN A 127.0.0.1 + localhost IN A 127.0.0.1 ns1 IN A 192.168.1.2 ns2 IN A 192.168.1.3 mx IN A 192.168.1.4 mail IN A 192.168.1.5 - The A record indicates machine names. As seen above, - ns1.example.org would resolve - to 192.168.1.2. + The A record indicates machine names. As seen above, + ns1.example.org would resolve + to 192.168.1.2. - IN A 192.168.1.1 + IN A 192.168.1.1 - This line assigns IP address - 192.168.1.1 to the current origin, - in this case example.org. + This line assigns IP address 192.168.1.1 to the current origin, + in this case example.org. - www IN CNAME @ + www IN CNAME @ - The canonical name record is usually used for giving aliases - to a machine. In the example, www is - aliased to the master machine whose name happens - to be the same as the domain name - example.org - (192.168.1.1). - CNAMEs can never be used together with another kind of record + The canonical name record is usually used for giving + aliases to a machine. In the example, www + is aliased to the master machine whose name + happens to be the same as the domain name example.org (192.168.1.1). CNAMEs can never be + used together with another kind of record for the same hostname. MX record - IN MX 10 mail.example.org. + IN MX 10 mail.example.org. - The MX record indicates which mail - servers are responsible for handling incoming mail for the - zone. mail.example.org is the - hostname of a mail server, and 10 is the priority of - that mail server. + The MX record indicates which mail + servers are responsible for handling incoming mail for the + zone. mail.example.org is the + hostname of a mail server, and 10 is the priority of + that mail server. - One can have several mail servers, with priorities of 10, - 20 and so on. A mail server attempting to deliver to example.org would first try the - highest priority MX (the record with the lowest priority - number), then the second highest, etc, until the mail can be - properly delivered. + One can have several mail servers, with priorities of + 10, 20 and so on. A mail server attempting to deliver to + example.org would first + try the highest priority MX (the record with the lowest + priority number), then the second highest, etc, until the + mail can be properly delivered. - For in-addr.arpa zone files (reverse DNS), the same format is - used, except with PTR entries instead of - A or CNAME. + For in-addr.arpa zone files (reverse DNS), the same + format is used, except with PTR entries instead of A or + CNAME. - $TTL 3600 + $TTL 3600 1.168.192.in-addr.arpa. IN SOA ns1.example.org. admin.example.org. ( 2006051501 ; Serial @@ -3870,8 +3947,8 @@ mail IN A 192.168.1.5 4 IN PTR mx.example.org. 5 IN PTR mail.example.org. - This file gives the proper IP address to hostname - mappings for the above fictitious domain. + This file gives the proper IP address to hostname + mappings for the above fictitious domain. It is worth noting that all names on the right side of a PTR record need to be fully qualified (i.e., end in @@ -3882,75 +3959,82 @@ mail IN A 192.168.1.5 Caching Name Server - BIND - caching name server + BIND + caching name server A caching name server is a name server whose primary role - is to resolve recursive queries. It simply asks queries of its - own, and remembers the answers for later use. + is to resolve recursive queries. It simply asks queries of + its own, and remembers the answers for later use. <acronym - role="Domain Name Security Extensions">DNSSEC</acronym> + role="Domain Name Security Extensions">DNSSEC - BIND - DNS security extensions + BIND + DNS security extensions Domain Name System Security Extensions, or DNSSEC for short, is a - suite of specifications to protect resolving name servers from forged - DNS data, such as spoofed DNS - records. By using digital signatures, a resolver can verify the - integrity of the record. Note that DNSSEC only provides - integrity via digitally signing the Resource Records (RRs). It provides neither - confidentiality nor protection against false end-user assumptions. - This means that it cannot protect against people going to example.net instead of example.com. The only thing - DNSSEC does is authenticate that the data has not - been compromised in transit. The security of DNS is - an important step in securing the Internet in general. For more - in-depth details of how DNSSEC works, the relevant - RFCs are a good place to start. See the list in - . + role="Domain Name Security Extensions">DNSSEC for + short, is a suite of specifications to protect resolving name + servers from forged DNS data, such as + spoofed DNS records. By using digital + signatures, a resolver can verify the integrity of the record. + Note that DNSSEC only + provides integrity via digitally signing the Resource + Records (RRs). It + provides neither confidentiality nor protection against false + end-user assumptions. This means that it cannot protect + against people going to example.net instead of example.com. The only thing + DNSSEC does is authenticate that the data + has not been compromised in transit. The security of + DNS is an important step in securing the + Internet in general. For more in-depth details of how + DNSSEC works, the relevant + RFCs are a good place to start. See the + list in . The following sections will demonstrate how to enable - DNSSEC for an authoritative DNS - server and a recursive (or caching) DNS server - running BIND 9. While all versions of - BIND 9 support DNSSEC, it is - necessary to have at least version 9.6.2 in order to be able to use the - signed root zone when validating DNS queries. This - is because earlier versions lack the required algorithms to enable - validation using the root zone key. It is strongly recommended to use - the latest version of BIND 9.7 or later to take - advantage of automatic key updating for the root key, as well as other - features to automatically keep zones signed and signatures up to date. - Where configurations differ between 9.6.2 and 9.7 and later, - differences will be pointed out. + DNSSEC for an authoritative + DNS server and a recursive (or caching) + DNS server running BIND + 9. While all versions of BIND 9 support + DNSSEC, it is necessary to have at least + version 9.6.2 in order to be able to use the signed root zone + when validating DNS queries. This is + because earlier versions lack the required algorithms to + enable validation using the root zone key. It is strongly + recommended to use the latest version of + BIND 9.7 or later to take advantage of + automatic key updating for the root key, as well as other + features to automatically keep zones signed and signatures up + to date. Where configurations differ between 9.6.2 and 9.7 + and later, differences will be pointed out. - Recursive <acronym>DNS</acronym> Server Configuration + Recursive <acronym>DNS</acronym> Server + Configuration Enabling DNSSEC validation of queries - performed by a recursive DNS server requires a few - changes to named.conf. Before making these - changes the root zone key, or trust anchor, must be acquired. - Currently the root zone key is not available in a file format - BIND understands, so it has to be manually - converted into the proper format. The key itself can be obtained by - querying the root zone for it using dig. + performed by a recursive DNS server + requires a few changes to named.conf. + Before making these changes the root zone key, or trust + anchor, must be acquired. Currently the root zone key is + not available in a file format BIND + understands, so it has to be manually converted into the + proper format. The key itself can be obtained by querying + the root zone for it using dig. By running &prompt.user; dig +multi +noall +answer DNSKEY . > root.dnskey - the key will end up in root.dnskey. The - contents should look something like this: + the key will end up in root.dnskey. + The contents should look something like this: . 93910 IN DNSKEY 257 3 8 ( AwEAAagAIKlVZrpC6Ia7gEzahOR+9W29euxhJhVVLOyQ @@ -3969,52 +4053,57 @@ mail IN A 192.168.1.5 EGJ/1h6dNaiXuRHwR+7oWh7DnzkIJChcTqlFrXDW3tjt ) ; key id = 34525 - Do not be alarmed if the obtained keys differ from this example. - They might have changed since these instructions were last updated. - This output actually contains two keys. The first key in the - listing, with the value 257 after the DNSKEY record type, is the one - needed. This value indicates that this is a Secure Entry Point - (SEP), - commonly known as a Key Signing Key (KSK). The second key, with value - 256, is a subordinate key, commonly called a Zone Signing Key - (ZSK). More on the + Do not be alarmed if the obtained keys differ from this + example. They might have changed since these instructions + were last updated. This output actually contains two keys. + The first key in the listing, with the value 257 after the + DNSKEY record type, is the one needed. This value indicates + that this is a Secure Entry Point (SEP), commonly known + as a Key Signing Key (KSK). The second key, + with value 256, is a subordinate key, commonly called a Zone + Signing Key (ZSK). More on the different key types later in . + linkend="dns-dnssec-auth">. Now the key must be verified and formatted so that - BIND can use it. To verify the key, generate a - DS - RR set. Create a file - containing these RRs - with + BIND can use it. To verify the key, + generate a DS + RR set. Create a + file containing these RRs with &prompt.user; dnssec-dsfromkey -f root-dnskey . > root.ds - These records use SHA-1 and SHA-256 respectively, and should - look similar to the following example, where the longer is using - SHA-256. + These records use SHA-1 and SHA-256 respectively, and + should look similar to the following example, where the + longer is using SHA-256. - . IN DS 19036 8 1 B256BD09DC8DD59F0E0F0D8541B8328DD986DF6E + . IN DS 19036 8 1 + B256BD09DC8DD59F0E0F0D8541B8328DD986DF6E . IN DS 19036 8 2 49AAC11D7B6F6446702E54A1607371607A1A41855200FD2CE1CDDE32F24E8FB5 - The SHA-256 RR can now be compared to the - digest in https://data.iana.org/root-anchors/root-anchors.xml. To be absolutely sure - that the key has not been tampered with the data in the - XML file can be verified using the - PGP signature in https://data.iana.org/root-anchors/root-anchors.asc. - - Next, the key must be formatted properly. This differs a - little between BIND versions 9.6.2 and 9.7 and - later. In version 9.7 support was added to automatically track - changes to the key and update it as necessary. This is done using - managed-keys as seen in the example below. When - using the older version, the key is added using a - trusted-keys statement and updates must be done - manually. For BIND 9.6.2 the format should look - like: + The SHA-256 RR can now be compared to + the digest in https://data.iana.org/root-anchors/root-anchors.xml. + To be absolutely sure that the key has not been tampered + with the data in the XML file can be + verified using the PGP signature in + https://data.iana.org/root-anchors/root-anchors.asc. + + Next, the key must be formatted properly. This differs + a little between BIND versions 9.6.2 and + 9.7 and later. In version 9.7 support was added to + automatically track changes to the key and update it as + necessary. This is done using + managed-keys as seen in the example + below. When using the older version, the key is added using + a trusted-keys statement and updates must + be done manually. For BIND 9.6.2 the + format should look like: trusted-keys { "." 257 3 8 @@ -4040,27 +4129,29 @@ mail IN A 192.168.1.5 QxA+Uk1ihz0="; }; - The root key can now be added to named.conf - either directly or by including a file containing the key. After - these steps, configure BIND to do + The root key can now be added to + named.conf either directly or by + including a file containing the key. After these steps, + configure BIND to do DNSSEC validation on queries by editing - named.conf and adding the following to the - options directive: + named.conf and adding the following to + the options directive: dnssec-enable yes; dnssec-validation yes; To verify that it is actually working use - dig to make a query for a signed zone - using the resolver just configured. A successful reply will contain - the AD flag to indicate the data was - authenticated. Running a query such as + dig to make a query for a signed + zone using the resolver just configured. A successful reply + will contain the AD flag to indicate the + data was authenticated. Running a query such as &prompt.user; dig @resolver +dnssec se ds - should return the DS RR for - the .se zone. In the flags: - section the AD flag should be set, as seen + should return the DS + RR for the .se zone. + In the flags: section the + AD flag should be set, as seen in: ... @@ -4072,44 +4163,52 @@ dnssec-validation yes; - Authoritative <acronym>DNS</acronym> Server Configuration + Authoritative <acronym>DNS</acronym> Server + Configuration In order to get an authoritative name server to serve a DNSSEC signed zone a little more work is - required. A zone is signed using cryptographic keys which must be - generated. It is possible to use only one key for this. The - preferred method however is to have a strong well-protected Key - Signing Key (KSK) that is + required. A zone is signed using cryptographic keys which + must be generated. It is possible to use only one key for + this. The preferred method however is to have a strong + well-protected Key Signing Key (KSK) that is not rotated very often and a Zone Signing Key (ZSK) that is rotated more - frequently. Information on recommended operational practices can be - found in RFC 4641: DNSSEC Operational Practices. Practices - regarding the root zone can be found in DNSSEC Practice Statement for the Root Zone + frequently. Information on recommended operational + practices can be found in RFC + 4641: DNSSEC Operational + Practices. Practices regarding the root zone can + be found in DNSSEC + Practice Statement for the Root Zone KSK operator and DNSSEC Practice Statement for the Root Zone + url="http://www.root-dnssec.org/wp-content/uploads/2010/06/vrsn-dps-00.txt">DNSSEC + Practice Statement for the Root Zone ZSK operator. The KSK is used to build a chain - of authority to the data in need of validation and as such is also - called a Secure Entry Point (SEP) key. A message digest of - this key, called a Delegation Signer (DS) record, must be published in - the parent zone to establish the trust chain. How this is - accomplished depends on the parent zone owner. The ZSK is used to sign the zone, and - only needs to be published there. + role="Key Signing Key">KSK is used to build a + chain of authority to the data in need of validation and as + such is also called a Secure Entry Point (SEP) key. A message + digest of this key, called a Delegation Signer (DS) record, must be + published in the parent zone to establish the trust chain. + How this is accomplished depends on the parent zone owner. + The ZSK is used to sign the + zone, and only needs to be published there. To enable DNSSEC for the example.com zone depicted in previous - examples, the first step is to use + role="domainname">example.com zone depicted in + previous examples, the first step is to use dnssec-keygen to generate the - KSK and ZSK key pair. This - key pair can utilize different cryptographic algorithms. It is - recommended to use RSA/SHA256 for the keys and 2048 bits key length - should be enough. To generate the KSK for example.com, run + KSK and ZSK key pair. + This key pair can utilize different cryptographic + algorithms. It is recommended to use RSA/SHA256 for the + keys and 2048 bits key length should be enough. To generate + the KSK for example.com, run &prompt.user; dnssec-keygen -f KSK -a RSASHA256 -b 2048 -n ZONE example.com @@ -4117,86 +4216,104 @@ dnssec-validation yes; &prompt.user; dnssec-keygen -a RSASHA256 -b 2048 -n ZONE example.com - dnssec-keygen outputs two files, the - public and the private keys in files named similar to - Kexample.com.+005+nnnnn.key (public) and - Kexample.com.+005+nnnnn.private (private). The - nnnnn part of the file name is a five digit key - ID. Keep track of which key ID belongs to which key. This is - especially important when having more than one key in a zone. It is - also possible to rename the keys. For each KSK - file do: + dnssec-keygen outputs two + files, the public and the private keys in files named + similar to Kexample.com.+005+nnnnn.key + (public) and + Kexample.com.+005+nnnnn.private + (private). The nnnnn part of the file + name is a five digit key ID. Keep track of which key ID + belongs to which key. This is especially important when + having more than one key in a zone. It is + also possible to rename the keys. For each + KSK file do: &prompt.user; mv Kexample.com.+005+nnnnn.key Kexample.com.+005+nnnnn.KSK.key &prompt.user; mv Kexample.com.+005+nnnnn.private Kexample.com.+005+nnnnn.KSK.private For the ZSK files, substitute - KSK for ZSK as necessary. The - files can now be included in the zone file, using the - $include statement. It should look something like - this: + KSK for ZSK as + necessary. The files can now be included in the zone file, + using the $include statement. It should + look something like this: - $include Kexample.com.+005+nnnnn.KSK.key ; KSK + $include Kexample.com.+005+nnnnn.KSK.key ; KSK $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK - Finally, sign the zone and tell BIND to use - the signed zone file. To sign a zone - dnssec-signzone is used. The command to - sign the zone example.com, located - in example.com.db would look similar to + Finally, sign the zone and tell BIND + to use the signed zone file. To sign a zone + dnssec-signzone is used. The + command to sign the zone example.com, located in + example.com.db would look similar + to - &prompt.user; dnssec-signzone -o example.com -k Kexample.com.+005+nnnnn.KSK example.com.db Kexample.com.+005+nnnnn.ZSK.key + &prompt.user; dnssec-signzone -o + example.com -k Kexample.com.+005+nnnnn.KSK example.com.db + Kexample.com.+005+nnnnn.ZSK.key - The key supplied to the argument is the - KSK and the other key file is the - ZSK that should be used in the signing. It is - possible to supply more than one KSK and - ZSK, which will result in the zone being signed - with all supplied keys. This can be needed to supply zone data - signed using more than one algorithm. The output of - dnssec-signzone is a zone file with all - RRs signed. This output will end up in a file - with the extension .signed, such as + The key supplied to the argument is + the KSK and the other key file is the + ZSK that should be used in the signing. + It is possible to supply more than one + KSK and ZSK, which + will result in the zone being signed with all supplied keys. + This can be needed to supply zone data signed using more + than one algorithm. The output of + dnssec-signzone is a zone file + with all RRs signed. This output will + end up in a file with the extension + .signed, such as example.com.db.signed. The DS records will also be - written to a separate file dsset-example.com. + role="Delegation Signer">DS records will also be + written to a separate file + dsset-example.com. To use this signed zone just modify the zone directive in named.conf to use example.com.db.signed. By default, the - signatures are only valid 30 days, meaning that the zone needs to be - resigned in about 15 days to be sure that resolvers are not caching - records with stale signatures. It is possible to make a script and a - cron job to do this. See relevant manuals for details. + signatures are only valid 30 days, meaning that the zone + needs to be resigned in about 15 days to be sure that + resolvers are not caching records with stale signatures. It + is possible to make a script and a cron job to do this. See + relevant manuals for details. Be sure to keep private keys confidential, as with all - cryptographic keys. When changing a key it is best to include the - new key into the zone, while still signing with the old one, and then - move over to using the new key to sign. After these steps are done - the old key can be removed from the zone. Failure to do this might - render the DNS data unavailable for a time, until - the new key has propagated through the DNS - hierarchy. For more information on key rollovers and other - DNSSEC operational issues, see RFC 4641: DNSSEC Operational practices. + cryptographic keys. When changing a key it is best to + include the new key into the zone, while still signing with + the old one, and then move over to using the new key to + sign. After these steps are done the old key can be removed + from the zone. Failure to do this might render the + DNS data unavailable for a time, until + the new key has propagated through the + DNS hierarchy. For more information on + key rollovers and other DNSSEC + operational issues, see RFC + 4641: DNSSEC Operational + practices. - Automation Using <acronym>BIND</acronym> 9.7 or Later - + Automation Using <acronym>BIND</acronym> 9.7 or + Later + Beginning with BIND version 9.7 a new - feature called Smart Signing was introduced. - This feature aims to make the key management and signing process - simpler by automating parts of the task. By putting the keys into a - directory called a key repository, and using the - new option auto-dnssec, it is possible to create a - dynamic zone which will be resigned as needed. To update this zone - use nsupdate with the new option - . rndc has also grown - the ability to sign zones with keys in the key repository, using the - option . To tell BIND to use - this automatic signing and zone updating for example.com, add the following to - named.conf: + feature called Smart Signing was + introduced. This feature aims to make the key management + and signing process simpler by automating parts of the task. + By putting the keys into a directory called a key + repository, and using the new option + auto-dnssec, it is possible to create a + dynamic zone which will be resigned as needed. To update + this zone use nsupdate with the + new option . + rndc has also grown the ability + to sign zones with keys in the key repository, using the + option . To tell + BIND to use this automatic signing and + zone updating for example.com, add the following + to named.conf: zone example.com { type master; @@ -4204,16 +4321,17 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK update-policy local; auto-dnssec maintain; file "/etc/named/dynamic/example.com.zone"; -}; +}; - After making these changes, generate keys for the zone as - explained in , put those keys in the - key repository given as the argument to the - key-directory in the zone configuration and the - zone will be signed automatically. Updates to a zone configured this - way must be done using nsupdate, which - will take care of re-signing the zone with the new data added. For - further details, see and the + After making these changes, generate keys for the zone + as explained in , put those + keys in the key repository given as the argument to the + key-directory in the zone configuration + and the zone will be signed automatically. Updates to a + zone configured this way must be done using + nsupdate, which will take care of + re-signing the zone with the new data added. For further + details, see and the BIND documentation. @@ -4222,9 +4340,8 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK Security Although BIND is the most common implementation of DNS, - there is always the issue of security. Possible and - exploitable security holes are sometimes found. - + there is always the issue of security. Possible and + exploitable security holes are sometimes found. While &os; automatically drops named into a &man.chroot.8; @@ -4233,9 +4350,10 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK DNS service attacks. It is always good idea to read CERT's security advisories - and to subscribe to the &a.security-notifications; to stay up to - date with the current Internet and &os; security issues. + url="http://www.cert.org/">CERT's security + advisories and to subscribe to the &a.security-notifications; + to stay up to date with the current Internet and &os; security + issues. If a problem arises, keeping sources up to date and @@ -4248,71 +4366,87 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK Further Reading BIND/named manual pages: - &man.rndc.8; &man.named.8; &man.named.conf.5; &man.nsupdate.8; - &man.dnssec-signzone.8; &man.dnssec-keygen.8; + &man.rndc.8; &man.named.8; &man.named.conf.5; &man.nsupdate.8; + &man.dnssec-signzone.8; &man.dnssec-keygen.8; - Official ISC - BIND Page - - - - Official ISC - BIND Forum - - - - O'Reilly - DNS and BIND 5th Edition - - - - Root - DNSSEC + Official ISC + BIND Page DNSSEC Trust Anchor Publication for the Root - Zone + url="https://www.isc.org/software/guild">Official ISC + BIND Forum - RFC1034 - - Domain Names - Concepts and Facilities + O'Reilly + DNS and BIND 5th Edition - RFC1035 - - Domain Names - Implementation and Specification + Root + DNSSEC - RFC4033 - - DNS Security Introduction and Requirements + DNSSEC + Trust Anchor Publication for the Root + Zone - RFC4034 - - Resource Records for the DNS Security Extensions + RFC1034 + - Domain Names - Concepts and Facilities - RFC4035 - - Protocol Modifications for the DNS Security - Extensions + RFC1035 + - Domain Names - Implementation and + Specification - RFC4641 - - DNSSEC Operational Practices + RFC4033 + - DNS Security Introduction and + Requirements - RFC 5011 - - Automated Updates of DNS Security (DNSSEC - Trust Anchors + RFC4034 + - Resource Records for the DNS Security + Extensions + + + + RFC4035 + - Protocol Modifications for the DNS Security + Extensions + + + + RFC4641 + - DNSSEC Operational Practices + + + + RFC 5011 + - Automated Updates of DNS Security + (DNSSEC + Trust Anchors @@ -4338,23 +4472,23 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK Overview &os; is used to run some of the busiest web sites in the - world. The majority of web servers on the Internet are using - the Apache HTTP Server. - Apache software packages should be - included on your FreeBSD installation media. If you did not - install Apache when you first - installed FreeBSD, then you can install it from the www/apache22 port. + world. The majority of web servers on the Internet are using + the Apache HTTP Server. + Apache software packages should be + included on your FreeBSD installation media. If you did not + install Apache when you first + installed FreeBSD, then you can install it from the www/apache22 port. Once Apache has been installed - successfully, it must be configured. + successfully, it must be configured. This section covers version 2.2.X of the - Apache HTTP Server as that is the - most widely used version for &os;. - For more detailed information beyond the scope of this document - about Apache 2.X, please see . + Apache HTTP Server as that is the + most widely used version for &os;. For more detailed + information beyond the scope of this document about + Apache 2.X, please see . @@ -4364,11 +4498,11 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK Apache configuration file - The main Apache HTTP Server configuration file is - installed as - /usr/local/etc/apache22/httpd.conf on &os;. - This file is a typical &unix; text configuration file with - comment lines beginning with the # + The main Apache HTTP Server + configuration file is installed as + /usr/local/etc/apache22/httpd.conf on + &os;. This file is a typical &unix; text configuration file + with comment lines beginning with the # character. A comprehensive description of all possible configuration options is outside the scope of this book, so only the most frequently modified directives will be described @@ -4380,11 +4514,14 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK This specifies the default directory hierarchy for - the Apache installation. Binaries are stored in the - bin and - sbin subdirectories - of the server root, and configuration files are stored in - etc/apache. + the Apache installation. + Binaries are stored in the bin and + sbin subdirectories + of the server root, and configuration files are stored + in etc/apache. @@ -4402,29 +4539,33 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK ServerName www.example.com - ServerName allows you to set a host name which is - sent back to clients for your server if it is different - than the one that the host is configured with (i.e., use www - instead of the host's real name). + ServerName allows you to set a + host name which is sent back to clients for your server + if it is different than the one that the host is + configured with (i.e., use www instead + of the host's real name). - DocumentRoot "/usr/local/www/apache22/data" + DocumentRoot + "/usr/local/www/apache22/data" - DocumentRoot: The directory out of which you will - serve your documents. By default, all requests are taken - from this directory, but symbolic links and aliases may - be used to point to other locations. + DocumentRoot: The directory out + of which you will serve your documents. By default, all + requests are taken from this directory, but symbolic + links and aliases may be used to point to other + locations. It is always a good idea to make backup copies of your - Apache configuration file before making changes. Once you are - satisfied with your initial configuration you are ready to - start running Apache. + Apache configuration file before + making changes. Once you are satisfied with your initial + configuration you are ready to start running + Apache. @@ -4434,20 +4575,20 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK starting or stopping The www/apache22 port - installs an &man.rc.8; script to aid in starting, stopping, and - restarting Apache, which can be found - in the Apache, which can be + found in the /usr/local/etc/rc.d/ directory. To launch Apache at system - startup, add the following line to - /etc/rc.conf: + startup, add the following line to + /etc/rc.conf: apache22_enable="YES" - If Apache should be started with - non-default options, the following line may be added to + If Apache should be started + with non-default options, the following line may be added to /etc/rc.conf: apache22_flags="" @@ -4455,10 +4596,10 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK The Apache configuration can be tested for errors before starting the httpd daemon for the first time, or after making subsequent - configuration changes while httpd is running. - This can be done by the &man.rc.8; script directly, or by the - &man.service.8; utility by issuing one of the following - commands: + configuration changes while httpd is + running. This can be done by the &man.rc.8; script directly, + or by the &man.service.8; utility by issuing one of the + following commands: &prompt.root; /usr/local/etc/rc.d/apache22 configtest &prompt.root; service apache22 configtest @@ -4466,8 +4607,8 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK It is important to note that the configtest is not an &man.rc.8; standard, - and should not be expected to work for all &man.rc.8; startup - scripts. + and should not be expected to work for all &man.rc.8; + startup scripts. If Apache does not report @@ -4480,15 +4621,14 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK &prompt.root; service apache22 start The httpd service can be tested by - entering - http://http://localhost - in a web browser, replacing localhost - with the fully-qualified domain name of the machine running - httpd, if it is not the local machine. - The default web page - that is displayed is - /usr/local/www/apache22/data/index.html. + in a web browser, replacing + localhost with the fully-qualified + domain name of the machine running httpd, + if it is not the local machine. The default web page that is + displayed is + /usr/local/www/apache22/data/index.html. @@ -4496,22 +4636,23 @@ $include Kexample.com.+005+nnnnn.ZSK.key ; ZSK Virtual Hosting Apache supports two different - types of Virtual Hosting. The first method is Name-based - Virtual Hosting. Name-based virtual hosting uses the clients - HTTP/1.1 headers to figure out the hostname. This allows many + types of Virtual Hosting. The first method is Name-based + Virtual Hosting. Name-based virtual hosting uses the clients + HTTP/1.1 headers to figure out the hostname. This allows many different domains to share the same IP address. To setup Apache to use - Name-based Virtual Hosting add an entry like the following to - your httpd.conf: + Name-based Virtual Hosting add an entry like the following to + your httpd.conf: NameVirtualHost * - If your webserver was named www.domain.tld and - you wanted to setup a virtual domain for - www.someotherdomain.tld then you would add - the following entries to - httpd.conf: + If your webserver was named www.domain.tld and you wanted to setup + a virtual domain for www.someotherdomain.tld then you would + add the following entries to + httpd.conf: <VirtualHost *> ServerName www.domain.tld @@ -4524,13 +4665,12 @@ DocumentRoot /www/someotherdomain.tld </VirtualHost> Replace the addresses with the addresses you want to use - and the path to the documents with what you are using. + and the path to the documents with what you are using. For more information about setting up virtual hosts, - please consult the official Apache - documentation at: . - + please consult the official Apache + documentation at: . @@ -4539,43 +4679,44 @@ DocumentRoot /www/someotherdomain.tld Apache modules - There are many different Apache modules available to add - functionality to the basic server. The FreeBSD Ports - Collection provides an easy way to install - Apache together with some of the - more popular add-on modules. + There are many different Apache + modules available to add functionality to the basic server. + The FreeBSD Ports Collection provides an easy way to install + Apache together with some of the + more popular add-on modules. - <application>mod_ssl</application> + <application>mod_ssl</application> web servers - secure + secure SSL cryptography - The mod_ssl module uses the OpenSSL library to provide - strong cryptography via the Secure Sockets Layer (SSL v2/v3) - and Transport Layer Security (TLS v1) protocols. This - module provides everything necessary to request a signed - certificate from a trusted certificate signing authority so - that you can run a secure web server on &os;. + The mod_ssl module uses the + OpenSSL library to provide strong cryptography via the + Secure Sockets Layer (SSL v2/v3) and Transport Layer + Security (TLS v1) protocols. This module provides + everything necessary to request a signed certificate from + a trusted certificate signing authority so that you can run + a secure web server on &os;. - The mod_ssl module is built by - default, but can be enabled by specifying + The mod_ssl module is built + by default, but can be enabled by specifying -DWITH_SSL at compile time. - Language Bindings + Language Bindings - There are Apache modules for most major scripting - languages. These modules typically make it possible to - write Apache modules entirely in - a scripting language. They are also often used as a - persistent interpreter embedded into the server that avoids - the overhead of starting an external interpreter and the - startup-time penalty for dynamic websites, as described in - the next section. + There are Apache modules for most major scripting + languages. These modules typically make it possible to + write Apache modules entirely in + a scripting language. They are also often used as a + persistent interpreter embedded into the server that avoids + the overhead of starting an external interpreter and the + startup-time penalty for dynamic websites, as described in + the next section. @@ -4583,44 +4724,48 @@ DocumentRoot /www/someotherdomain.tld Dynamic Websites web servers - dynamic + dynamic In the last decade, more businesses have turned to the - Internet in order to enhance their revenue and increase - exposure. This has also increased the need for interactive - web content. While some companies, such as µsoft;, - have introduced solutions into their proprietary products, - the open source community answered the call. Modern options - for dynamic web content include Django, Ruby on Rails, - mod_perl2, and - mod_php. + Internet in order to enhance their revenue and increase + exposure. This has also increased the need for interactive + web content. While some companies, such as µsoft;, + have introduced solutions into their proprietary products, + the open source community answered the call. Modern options + for dynamic web content include Django, Ruby on Rails, + mod_perl2, and + mod_php. - Django + Django Python Django - Django is a BSD licensed framework designed to allow - developers to write high performance, elegant web - applications quickly. It provides an object-relational - mapper so that data types are developed as Python objects, - and a rich dynamic database-access API is provided for those - objects without the developer ever having to write SQL. It - also provides an extensible template system so that the - logic of the application is separated from the HTML - presentation. + Django is a BSD licensed framework designed to allow + developers to write high performance, elegant web + applications quickly. It provides an object-relational + mapper so that data types are developed as Python objects, + and a rich dynamic database-access API is provided for those + objects without the developer ever having to write SQL. It + also provides an extensible template system so that the + logic of the application is separated from the HTML + presentation. - Django depends on mod_python, - Apache, and an SQL database - engine of your choice. The FreeBSD Port will install all of - these pre-requisites for you with the appropriate flags. + Django depends on mod_python, + Apache, and an SQL database + engine of your choice. The FreeBSD Port will install all of + these pre-requisites for you with the appropriate + flags. - Installing Django with <application>Apache2</application>, <application>mod_python3</application>, and <application>PostgreSQL</application> + Installing Django with + <application>Apache2</application>, + <application>mod_python3</application>, and + <application>PostgreSQL</application> &prompt.root; cd /usr/ports/www/py-django; make all install clean -DWITH_MOD_PYTHON3 -DWITH_POSTGRESQL - + Once Django and these pre-requisites are installed, you will need to create a Django project directory and then @@ -4630,12 +4775,12 @@ DocumentRoot /www/someotherdomain.tld Apache Configuration for Django/mod_python - You will need to add a line to the apache - httpd.conf file to configure Apache - to pass requests for certain URLs to your web - application: + You will need to add a line to the apache + httpd.conf file to configure Apache + to pass requests for certain URLs to your web + application: - <Location "/"> + <Location "/"> SetHandler python-program PythonPath "['/dir/to/your/django/packages/'] + sys.path" PythonHandler django.core.handlers.modpython @@ -4647,7 +4792,7 @@ DocumentRoot /www/someotherdomain.tld - Ruby on Rails + Ruby on Rails Ruby on Rails @@ -4657,32 +4802,34 @@ DocumentRoot /www/someotherdomain.tld powerful applications quickly. It can be installed easily from the ports system. - &prompt.root; cd /usr/ports/www/rubygem-rails; make all install clean + &prompt.root; cd /usr/ports/www/rubygem-rails; make all install clean - <application>mod_perl2</application> + <application>mod_perl2</application> - mod_perl2 - Perl - + mod_perl2 + Perl + - The Apache/Perl integration project brings together the - full power of the Perl programming language and the Apache - HTTP Server. With the mod_perl2 module it is possible to - write Apache modules entirely in Perl. In addition, the - persistent interpreter embedded in the server avoids the - overhead of starting an external interpreter and the penalty - of Perl start-up time. + The Apache/Perl integration + project brings together the full power of the Perl + programming language and the + Apache HTTP Server. With the + mod_perl2 module it is possible + to write Apache modules entirely + in Perl. In addition, the persistent interpreter embedded + in the server avoids the overhead of starting an external + interpreter and the penalty of Perl start-up time. - mod_perl2 is available in the - www/mod_perl2 - port. - + mod_perl2 is available in the + www/mod_perl2 + port. + - - + + Tom @@ -4690,21 +4837,21 @@ DocumentRoot /www/someotherdomain.tld Written by - - <application>mod_php</application> + + <application>mod_php</application> - mod_php - PHP - + mod_php + PHP + PHP, also known as PHP: - Hypertext Preprocessor is a general-purpose scripting - language that is especially suited for Web development. - Capable of being embedded into HTML its - syntax draws upon C, &java;, and Perl with the intention of - allowing web developers to write dynamically generated - webpages quickly. + Hypertext Preprocessor is a general-purpose + scripting language that is especially suited for Web + development. Capable of being embedded into + HTML its syntax draws upon C, &java;, + and Perl with the intention of allowing web developers to + write dynamically generated webpages quickly. To gain support for PHP5 for the Apache web server, begin by @@ -4712,8 +4859,8 @@ DocumentRoot /www/someotherdomain.tld lang/php5 port. - If the lang/php5 port - is being installed for the first time, available + If the lang/php5 + port is being installed for the first time, available OPTIONS will be displayed automatically. If a menu is not displayed, i.e., because the lang/php5 port has been installed @@ -4736,19 +4883,20 @@ DocumentRoot /www/someotherdomain.tld mod_php4 is needed instead of mod_php5, then please use the lang/php4 port. The - lang/php4 port supports - many of the configuration and build-time options of the - lang/php5 port. + lang/php4 port + supports many of the configuration and build-time options + of the lang/php5 + port. This will install and configure the modules required - to support dynamic PHP applications. Check - to ensure the following sections have been added to + to support dynamic PHP applications. + Check to ensure the following sections have been added to /usr/local/etc/apache22/httpd.conf: LoadModule php5_module libexec/apache/libphp5.so - AddModule mod_php5.c + AddModule mod_php5.c <IfModule mod_php5.c> DirectoryIndex index.php index.html </IfModule> @@ -4757,10 +4905,10 @@ DocumentRoot /www/someotherdomain.tld AddType application/x-httpd-php-source .phps </IfModule> - Once completed, a simple call to the - apachectl command for a graceful - restart is needed to load the PHP - module: + Once completed, a simple call to the + apachectl command for a graceful + restart is needed to load the PHP + module: &prompt.root; apachectl graceful @@ -4769,23 +4917,23 @@ DocumentRoot /www/someotherdomain.tld the selected OPTIONS are saved automatically by the &os; Ports framework. - The PHP support in &os; is extremely - modular so the base install is very limited. It is very easy - to add support using the - lang/php5-extensions port. - This port provides a menu driven interface to - PHP extension installation. - Alternatively, individual extensions can be installed using - the appropriate port. + The PHP support in &os; is extremely + modular so the base install is very limited. It is very + easy to add support using the lang/php5-extensions port. + This port provides a menu driven interface to + PHP extension installation. + Alternatively, individual extensions can be installed using + the appropriate port. For instance, to add support for the MySQL database server to PHP5, simply install the port databases/php5-mysql. - After installing an extension, the - Apache server must be reloaded to - pick up the new configuration changes: + After installing an extension, the + Apache server must be reloaded to + pick up the new configuration changes: &prompt.root; apachectl graceful @@ -4862,34 +5010,36 @@ DocumentRoot /www/someotherdomain.tld users before they reach the login prompt. After a successful login, the contents of the file /etc/ftpmotd will be displayed. Note - that the path to this file is relative to the login environment, so the - file ~ftp/etc/ftpmotd would be displayed - for anonymous users. + that the path to this file is relative to the login + environment, so the file ~ftp/etc/ftpmotd + would be displayed for anonymous users. Once the FTP server has been configured properly, it must - be enabled in /etc/inetd.conf. All that - is required here is to remove the comment symbol - # from in front of the existing - ftpd line : + be enabled in /etc/inetd.conf. All that + is required here is to remove the comment symbol + # from in front of the existing + ftpd line : ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l As explained in , - the inetd configuration must be reloaded - after this configuration file is changed. Please refer to - for details on enabling - inetd on your system. + the inetd configuration must be + reloaded after this configuration file is changed. Please + refer to for details + on enabling inetd on your + system. Alternatively, ftpd can also be - started as a stand-alone server. In this case, it is sufficient to - set the appropriate variable in + started as a stand-alone server. In this case, it is + sufficient to set the appropriate variable in /etc/rc.conf: ftpd_enable="YES" - After setting the above variable, the stand-alone server will be - started at the next reboot, or it can be started manually by - executing the following command as root: + After setting the above variable, the stand-alone server + will be started at the next reboot, or it can be started + manually by executing the following command as + root: &prompt.root; /etc/rc.d/ftpd start @@ -4907,11 +5057,11 @@ DocumentRoot /www/someotherdomain.tld FTP The ftpd daemon uses - &man.syslog.3; to log messages. By default, the system log - daemon will put messages related to FTP in the - /var/log/xferlog file. The location of - the FTP log can be modified by changing the following line in - /etc/syslog.conf: + &man.syslog.3; to log messages. By default, the system log + daemon will put messages related to FTP in the + /var/log/xferlog file. The location of + the FTP log can be modified by changing the following line in + /etc/syslog.conf: ftp.info /var/log/xferlog @@ -4921,13 +5071,13 @@ DocumentRoot /www/someotherdomain.tld Be aware of the potential problems involved with running - an anonymous FTP server. In particular, you should think - twice about allowing anonymous users to upload files. You may - find that your FTP site becomes a forum for the trade of - unlicensed commercial software or worse. If you do need to - allow anonymous FTP uploads, then you should set up the - permissions so that these files can not be read by other - anonymous users until they have been reviewed. + an anonymous FTP server. In particular, you should think + twice about allowing anonymous users to upload files. You may + find that your FTP site becomes a forum for the trade of + unlicensed commercial software or worse. If you do need to + allow anonymous FTP uploads, then you should set up the + permissions so that these files can not be read by other + anonymous users until they have been reviewed. @@ -4942,7 +5092,8 @@ DocumentRoot /www/someotherdomain.tld - File and Print Services for µsoft.windows; Clients (Samba) + File and Print Services for µsoft.windows; Clients + (Samba) Samba server Microsoft Windows @@ -4959,16 +5110,16 @@ DocumentRoot /www/someotherdomain.tld Overview Samba is a popular open source - software package that provides file and print services for - µsoft.windows; clients. Such clients can connect to and - use FreeBSD filespace as if it was a local disk drive, or - FreeBSD printers as if they were local printers. + software package that provides file and print services for + µsoft.windows; clients. Such clients can connect to and + use FreeBSD filespace as if it was a local disk drive, or + FreeBSD printers as if they were local printers. Samba software packages should - be included on your FreeBSD installation media. If you did - not install Samba when you first - installed FreeBSD, then you can install it from the net/samba34 port or package. + be included on your FreeBSD installation media. If you did + not install Samba when you first + installed FreeBSD, then you can install it from the net/samba34 port or package. @@ -4978,47 +5129,50 @@ DocumentRoot /www/someotherdomain.tld Configuration A default Samba configuration - file is installed as - /usr/local/share/examples/samba34/smb.conf.default. This - file must be copied to - /usr/local/etc/smb.conf and customized - before Samba can be used. + file is installed as + /usr/local/share/examples/samba34/smb.conf.default. + This file must be copied to + /usr/local/etc/smb.conf and customized + before Samba can be used. The smb.conf file contains runtime - configuration information for - Samba, such as definitions of the - printers and file system shares that you would - like to share with &windows; clients. The - Samba package includes a web based - tool called swat which provides a - simple way of configuring the smb.conf - file. + configuration information for + Samba, such as definitions of the + printers and file system shares that you would + like to share with &windows; clients. The + Samba package includes a web based + tool called swat which provides a + simple way of configuring the smb.conf + file. Using the Samba Web Administration Tool (SWAT) The Samba Web Administration Tool (SWAT) runs as a - daemon from inetd. Therefore, the - following line in /etc/inetd.conf - should be uncommented before swat can be - used to configure Samba: + daemon from inetd. Therefore, + the following line in /etc/inetd.conf + should be uncommented before swat + can be used to configure + Samba: swat stream tcp nowait/400 root /usr/local/sbin/swat swat - As explained in , - the inetd configuration must be reloaded after this configuration - file is changed. + As explained in , + the inetd configuration must be + reloaded after this configuration file is changed. Once swat has been enabled in inetd.conf, you can use a browser to - connect to . You will - first have to log on with the system root account. + connect to . You + will first have to log on with the system + root account. Once you have successfully logged on to the main Samba configuration page, you can browse the system documentation, or begin by clicking on the - Globals tab. The Globals section corresponds to the + Globals tab. The + Globals section corresponds to the variables that are set in the [global] section of /usr/local/etc/smb.conf. @@ -5033,13 +5187,13 @@ DocumentRoot /www/someotherdomain.tld when configuring Samba are: - + workgroup NT Domain-Name or Workgroup-Name for the computers - that will be accessing this server. + that will be accessing this server. @@ -5048,9 +5202,10 @@ DocumentRoot /www/someotherdomain.tld NetBIOS - This sets the NetBIOS name by which a Samba server - is known. By default it is the same as the first - component of the host's DNS name. + This sets the NetBIOS name by which a + Samba server is known. + By default it is the same as the first component of + the host's DNS name. @@ -5064,7 +5219,7 @@ DocumentRoot /www/someotherdomain.tld about the server. - + @@ -5076,25 +5231,25 @@ DocumentRoot /www/someotherdomain.tld client users. The following directives control these options: - + security The two most common options here are - security = share and security - = user. If your clients use usernames that - are the same as their usernames on your &os; machine - then you will want to use user level security. This - is the default security policy and it requires clients - to first log on before they can access shared - resources. + security = share and + security = user. If your clients + use usernames that are the same as their usernames on + your &os; machine then you will want to use user level + security. This is the default security policy and it + requires clients to first log on before they can + access shared resources. In share level security, client do not need to log - onto the server with a valid username and password - before attempting to connect to a shared resource. - This was the default security model for older versions - of Samba. + onto the server with a valid username and password + before attempting to connect to a shared resource. + This was the default security model for older versions + of Samba. @@ -5107,10 +5262,10 @@ DocumentRoot /www/someotherdomain.tld Samba has several - different backend authentication models. You can - authenticate clients with LDAP, NIS+, a SQL database, - or a modified password file. The default - authentication method is smbpasswd, + different backend authentication models. You can + authenticate clients with LDAP, NIS+, a SQL database, + or a modified password file. The default + authentication method is smbpasswd, and that is all that will be covered here. @@ -5118,23 +5273,25 @@ DocumentRoot /www/someotherdomain.tld Assuming that the default smbpasswd backend is used, the - /usr/local/etc/samba/smbpasswd file must - be created to allow Samba to + /usr/local/etc/samba/smbpasswd file + must be created to allow Samba to authenticate clients. If you would like to give - your &unix; user accounts access from &windows; clients, use the - following command: + your &unix; user accounts access from &windows; clients, use + the following command: &prompt.root; smbpasswd -a username - The recommended backend is now tdbsam, and - the following command should be used to add user accounts: + The recommended backend is now + tdbsam, and the following command + should be used to add user accounts: &prompt.root; pdbedit username Please see the Official Samba HOWTO + url="http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/">Official + Samba HOWTO for additional information about configuration options. With the basics outlined here, you should have everything you need to start running @@ -5145,12 +5302,12 @@ DocumentRoot /www/someotherdomain.tld Starting <application>Samba</application> - The net/samba34 port adds - a new startup script, which can be used to control + The net/samba34 port + adds a new startup script, which can be used to control Samba. To enable this script, so that it can be used for example to start, stop or restart - Samba, add the following line to the - /etc/rc.conf file: + Samba, add the following line to + the /etc/rc.conf file: samba_enable="YES" @@ -5160,8 +5317,9 @@ DocumentRoot /www/someotherdomain.tld smbd_enable="YES" - This will also configure Samba - to automatically start at system boot time. + This will also configure + Samba to automatically start at + system boot time. It is possible then to start @@ -5176,23 +5334,24 @@ Starting smbd. information about using rc scripts. Samba actually consists of - three separate daemons. You should see that both the - nmbd and smbd daemons - are started by the samba script. If - you enabled winbind name resolution services in - smb.conf, then you will also see that - the winbindd daemon is started. + three separate daemons. You should see that both the + nmbd and + smbd daemons are started by the + samba script. If you enabled winbind + name resolution services in smb.conf, + then you will also see that the + winbindd daemon is started. You can stop Samba at any time - by typing : + by typing : &prompt.root; /usr/local/etc/rc.d/samba stop Samba is a complex software - suite with functionality that allows broad integration with - µsoft.windows; networks. For more information about - functionality beyond the basic installation described here, - please see . + suite with functionality that allows broad integration with + µsoft.windows; networks. For more information about + functionality beyond the basic installation described here, + please see . @@ -5215,14 +5374,14 @@ Starting smbd. Overview Over time, a computer's clock is prone to drift. The - Network Time Protocol (NTP) is one way to ensure your clock stays - accurate. + Network Time Protocol (NTP) is one way to ensure your clock + stays accurate. Many Internet services rely on, or greatly benefit from, computers' clocks being accurate. For example, a web server - may receive requests to send a file if it has been modified since a - certain time. In a local area network environment, it is - essential that computers sharing files from the same file + may receive requests to send a file if it has been modified + since a certain time. In a local area network environment, it + is essential that computers sharing files from the same file server have synchronized clocks so that file timestamps stay consistent. Services such as &man.cron.8; also rely on an accurate system clock to run commands at the specified @@ -5232,10 +5391,11 @@ Starting smbd. NTP ntpd - FreeBSD ships with the &man.ntpd.8; NTP server which can be used to query - other NTP - servers to set the clock on your machine or provide time + FreeBSD ships with the &man.ntpd.8; NTP server which can + be used to query other NTP servers to set + the clock on your machine or provide time services to others. @@ -5356,7 +5516,7 @@ driftfile /var/db/ntp.drift server, add the following line to /etc/ntp.conf: - restrict default ignore + restrict default ignore This will also prevent access from your server to @@ -5366,16 +5526,17 @@ driftfile /var/db/ntp.drift &man.ntp.conf.5; manual for more information. - If you only want to allow machines within your own + If you only want to allow machines within your own network to synchronize their clocks with your server, but ensure they are not allowed to configure the server or used as peers to synchronize against, add - restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap + restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap - instead, where 192.168.1.0 is - an IP address on your network and 255.255.255.0 is your network's + instead, where 192.168.1.0 is an IP address on + your network and 255.255.255.0 is your network's netmask. /etc/ntp.conf can contain multiple @@ -5404,8 +5565,8 @@ driftfile /var/db/ntp.drift - Using <application>ntpd</application> with a Temporary Internet - Connection + Using <application>ntpd</application> with a Temporary + Internet Connection The &man.ntpd.8; program does not need a permanent connection to the Internet to function properly. However, if @@ -5426,8 +5587,8 @@ driftfile /var/db/ntp.drift set filter alive 2 permit 0/0 0/0 For more details see the PACKET - FILTERING section in &man.ppp.8; and the examples in - /usr/share/examples/ppp/. + FILTERING section in &man.ppp.8; and the examples + in /usr/share/examples/ppp/. Some Internet access providers block low-numbered ports, @@ -5448,11 +5609,11 @@ driftfile /var/db/ntp.drift - - Tom - Rhodes - Contributed by - + + Tom + Rhodes + Contributed by + @@ -5467,15 +5628,15 @@ driftfile /var/db/ntp.drift comfortable. Centralized logging to a specific logging host can reduce - some of the administrative burden of log file administration. Log - file aggregation, merging and rotation can be configured in one - location, using the native tools of &os;, such as &man.syslogd.8; - and &man.newsyslog.8;. In the - following example configuration, host A, named - logserv.example.com, will collect - logging information for the local network. - Host B, named - logclient.example.com will pass + some of the administrative burden of log file administration. + Log file aggregation, merging and rotation can be configured in + one location, using the native tools of &os;, such as + &man.syslogd.8; and &man.newsyslog.8;. In the following example + configuration, host A, named logserv.example.com, will collect + logging information for the local network. Host + B, named logclient.example.com will pass logging information to the server system. In live configurations, both hosts require proper forward and reverse DNS or entries in @@ -5528,7 +5689,7 @@ driftfile /var/db/ntp.drift Once added, all facility messages will - be logged to the file specified previously, + be logged to the file specified previously, /var/log/logclient.log. The server machine must also have the following listing @@ -5537,13 +5698,14 @@ driftfile /var/db/ntp.drift syslogd_enable="YES" syslogd_flags="-a logclient.example.com -v -v" - The first option will enable the syslogd - daemon on boot up, and the second option allows data from the - specified client to be accepted on this server. The latter - part, using , will increase the verbosity - of logged messages. This is extremely useful for tweaking - facilities as administrators are able to see what type of - messages are being logged under which facility. + The first option will enable the + syslogd daemon on boot up, and the second + option allows data from the specified client to be accepted on + this server. The latter part, using , + will increase the verbosity of logged messages. This is + extremely useful for tweaking facilities as administrators are + able to see what type of messages are being logged under which + facility. Multiple options may be specified to allow logging from multiple clients. IP @@ -5557,15 +5719,15 @@ syslogd_flags="-a logclient.example.com -v -v" &prompt.root; touch /var/log/logclient.log - At this point, the syslogd daemon should - be restarted and verified: + At this point, the syslogd daemon + should be restarted and verified: &prompt.root; /etc/rc.d/syslogd restart &prompt.root; pgrep syslog - If a PID is returned, the server has been - restarted successfully, and client configuration may begin. If - the server has not restarted, consult the + If a PID is returned, the server has + been restarted successfully, and client configuration may + begin. If the server has not restarted, consult the /var/log/messages log for any output. @@ -5574,16 +5736,17 @@ syslogd_flags="-a logclient.example.com -v -v" Log Client Configuration A logging client is a machine which sends log information - to a logging server in addition to keeping local copies. + to a logging server in addition to keeping local + copies. - Similar to log servers, clients must also meet a few minimum - requirements: + Similar to log servers, clients must also meet a few + minimum requirements: &man.syslogd.8; must be configured to send messages of - specific types to a log server, which must accept - them; + specific types to a log server, which must accept + them; @@ -5614,14 +5777,15 @@ syslogd_flags="-s -v -v" Facilities describe the system part for which a message is generated. For an example, ftp and - ipfw are both facilities. When log messages - are generated for those two services, they will normally include - those two utilities in any log messages. Facilities are - accompanied with a priority or level, which is used to mark how - important a log message is. The most common will be the - warning and info. Please - refer to the &man.syslog.3; manual page for a full list of - available facilities and priorities. + ipfw are both facilities. When log + messages are generated for those two services, they will + normally include those two utilities in any log messages. + Facilities are accompanied with a priority or level, which + is used to mark how important a log message is. The most + common will be the warning and + info. Please refer to the &man.syslog.3; + manual page for a full list of available facilities and + priorities. The logging server must be defined in the client's /etc/syslog.conf. In this instance, @@ -5636,8 +5800,8 @@ syslogd_flags="-s -v -v" &prompt.root; /etc/rc.d/syslogd restart - To test that log messages are being sent across the network, - use &man.logger.1; on the client to send a message to + To test that log messages are being sent across the + network, use &man.logger.1; on the client to send a message to syslogd: &prompt.root; logger "Test message from logclient" @@ -5651,12 +5815,12 @@ syslogd_flags="-s -v -v" Debugging Log Servers - In certain cases, debugging may be required if messages are - not being received on the log server. There are several reasons - this may occur; however, the most common two are network - connection issues and DNS issues. To test - these cases, ensure both hosts are able to reach one another - using the hostname specified in + In certain cases, debugging may be required if messages + are not being received on the log server. There are several + reasons this may occur; however, the most common two are + network connection issues and DNS issues. + To test these cases, ensure both hosts are able to reach one + another using the hostname specified in /etc/rc.conf. If this appears to be working properly, an alternation to the syslogd_flags option in @@ -5664,9 +5828,9 @@ syslogd_flags="-s -v -v" In the following example, /var/log/logclient.log is empty, and the - /var/log/messages files indicate no reason - for the failure. To increase debugging output, change the - syslogd_flags option to look like the + /var/log/messages files indicate no + reason for the failure. To increase debugging output, change + the syslogd_flags option to look like the following example, and issue a restart: syslogd_flags="-d -a logclien.example.com -v -v" @@ -5718,12 +5882,12 @@ Logging to FILE /var/log/messages Security Considerations As with any network service, security requirements should - be considered before implementing this configuration. At times, - log files may contain sensitive data about services enabled on - the local host, user accounts, and configuration data. Network - data sent from the client to the server will not be encrypted - nor password protected. If a need for encryption exists, it - might be possible to use + be considered before implementing this configuration. At + times, log files may contain sensitive data about services + enabled on the local host, user accounts, and configuration + data. Network data sent from the client to the server will + not be encrypted nor password protected. If a need for + encryption exists, it might be possible to use security/stunnel, which will transmit data over an encrypted tunnel.