doc: bosserver runs in the background
[openafs.git] / doc / xml / AdminGuide / auagd007.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <chapter id="HDRWQ29">
4   <title>Issues in Cell Configuration and Administration</title>
5
6   <para>This chapter discusses many of the issues to consider when
7   configuring and administering a cell, and directs you to detailed
8   related information available elsewhere in this guide. It is assumed you
9   are already familiar with the material in <link linkend="HDRWQ5">An
10   Overview of OpenAFS Administration</link>.</para>
11
12   <para>It is best to read this chapter before installing your cell's
13   first file server machine or performing any other administrative
14   task.
15
16   <indexterm>
17     <primary>AFS</primary>
18
19     <secondary>differences from UNIX summarized</secondary>
20   </indexterm>
21
22   <indexterm>
23     <primary>UNIX</primary>
24
25     <secondary>differences from AFS summarized</secondary>
26   </indexterm>
27
28   <indexterm>
29     <primary>differences</primary>
30
31     <secondary>between AFS and UNIX, summarized</secondary>
32   </indexterm>
33   </para>
34
35   <sect1 id="HDRWQ30">
36     <title>Differences between AFS and UNIX: A Summary</title>
37
38     <para>AFS behaves like a standard UNIX file system in most respects,
39     while also making file sharing easy within and between cells. This
40     section describes some differences between AFS and the UNIX file
41     system, referring you to more detailed information as
42     appropriate.</para>
43
44     <indexterm>
45       <primary>protection</primary>
46
47       <secondary>AFS compared to UNIX</secondary>
48     </indexterm>
49
50     <sect2 id="Header_35">
51       <title>Differences in File and Directory Protection</title>
52
53       <para>AFS augments the standard UNIX file protection mechanism in
54       two ways: it associates an <emphasis>access control list
55       (ACL)</emphasis> with each directory, and it enables users to define
56       a large number of their own groups, which can be placed on
57       ACLs.</para>
58
59       <para>AFS uses ACLs to protect files and directories, rather than
60       relying exclusively on the mode bits. This has several implications,
61       which are discussed further in the indicated sections:
62       <itemizedlist>
63           <listitem>
64             <para>AFS ACLs use seven access permissions rather than the
65             three UNIX mode bits. See <link linkend="HDRWQ567">The AFS ACL
66             Permissions</link>.</para>
67           </listitem>
68
69           <listitem>
70             <para>For directories, AFS ignores the UNIX mode bits. For
71             files, AFS uses only the first set of mode bits (the <emphasis
72             role="bold">owner</emphasis> bits), and their meaning
73             interacts with permissions on the directory's ACL. See <link
74             linkend="HDRWQ580">How AFS Interprets the UNIX Mode
75             Bits</link>.</para>
76           </listitem>
77
78           <listitem>
79             <para>A directory's ACL protects all of the files in a
80             directory in the same manner. To apply a more restrictive set
81             of AFS permissions to certain file, place it in directory with
82             a different ACL. If a directory must contain files with
83             different permissions, use symbolic links to point to files
84             stored in directories with different ACLs.</para>
85           </listitem>
86
87           <listitem>
88             <para>Moving a file to a different directory changes its
89             protection. See <link linkend="HDRWQ566">Differences Between
90             UFS and AFS Data Protection</link>.</para>
91           </listitem>
92
93           <listitem>
94             <para>An ACL can include about 20 entries granting different
95             combinations of permissions to different users or groups,
96             rather than only the three UNIX entities represented by the
97             three sets of mode bits. See <link
98             linkend="HDRWQ566">Differences Between UFS and AFS Data
99             Protection</link>.</para>
100           </listitem>
101
102           <listitem>
103             <para>You can designate an AFS file as write-only as in the
104             UNIX file system, by setting only the <emphasis
105             role="bold">w</emphasis> (<emphasis
106             role="bold">write</emphasis>) mode bit. You cannot designate
107             an AFS directory as write-only, because AFS ignores the mode
108             bits on a directory. See <link linkend="HDRWQ580">How AFS
109             Interprets the UNIX Mode Bits</link>.</para>
110           </listitem>
111       </itemizedlist>
112       </para>
113
114       <para>AFS enables users to create groups and add other users to
115       those groups. Placing these groups on ACLs extends the same
116       permissions to a number of exactly specified users at the same time,
117       which is much more convenient than placing the individuals on the
118       ACLs directly. See <link linkend="HDRWQ531">Administering the
119       Protection Database</link>.</para>
120
121       <para>There are also system-defined groups, <emphasis
122       role="bold">system:anyuser</emphasis> and <emphasis
123       role="bold">system:authuser</emphasis>, whose presence on an ACL
124       extends access to a wide range of users at once. See <link
125       linkend="HDRWQ535">The System Groups</link> and <link
126       linkend="HDRWQ571">Using Groups on ACLs</link>.</para>
127
128       <indexterm>
129         <primary>authentication</primary>
130
131         <secondary>AFS compared to UNIX</secondary>
132       </indexterm>
133
134       <indexterm>
135         <primary>password</primary>
136
137         <secondary>AFS compared to UNIX</secondary>
138       </indexterm>
139     </sect2>
140
141     <sect2 id="HDRWQ31">
142       <title>Differences in Authentication</title>
143
144       <para>Just as the AFS filespace is distinct from each machine's
145       local file system, AFS authentication is separate from local
146       login. This has two practical implications, which will already be
147       familiar to users and system administrators who use Kerberos for
148       authentication.
149         <itemizedlist>
150           <listitem>
151             <para>To access AFS files, users must log into the local
152             machine as normal, obtain Kerberos tickets, and then obtain
153             AFS tokens. This process can often be automated through the
154             system authentication configuration so that the user logs into
155             the system as normal and obtains Kerberos tickets and AFS
156             tokens transparently. If you cannot or chose not to configure
157             the system this way, your users must login and authenticate in
158             separate steps, as detailed in the <emphasis>OpenAFS User
159             Guide</emphasis>.</para>
160           </listitem>
161
162           <listitem>
163             <para>Passwords may be stored in two separate places: the
164             Kerberos KDC and, optionally, each machine's local user
165             database (<emphasis role="bold">/etc/passwd</emphasis> or
166             equivalent) for the local system. A user's passwords in the
167             two places can differ if desired.</para>
168           </listitem>
169         </itemizedlist>
170       </para>
171     </sect2>
172
173     <sect2 id="Header_37">
174       <title>Differences in the Semantics of Standard UNIX
175       Commands</title>
176
177       <para>This section summarizes how AFS modifies the functionality of
178       some UNIX commands.
179         <variablelist>
180           <varlistentry>
181             <term><emphasis role="bold">The chmod
182             command</emphasis></term>
183
184             <listitem>
185               <indexterm>
186                 <primary>chmod command</primary>
187                 <secondary>AFS compared to UNIX</secondary>
188               </indexterm>
189
190               <indexterm>
191                 <primary>commands</primary>
192                 <secondary>chmod (AFS compared to UNIX)</secondary>
193               </indexterm>
194
195               <indexterm>
196                 <primary>setuid programs</primary>
197                 <secondary>setting mode bits</secondary>
198               </indexterm>
199
200               <para>Only members of the <emphasis
201               role="bold">system:administrators</emphasis> group can use
202               this command to turn on the setuid, setgid or sticky mode
203               bits on AFS files. For more information, see <link
204               linkend="HDRWQ409">Determining if a Client Can Run Setuid
205               Programs</link>.</para>
206             </listitem>
207           </varlistentry>
208
209           <varlistentry>
210             <term><emphasis role="bold">The chown
211             command</emphasis></term>
212
213             <listitem>
214               <indexterm>
215                 <primary>chown command</primary>
216                 <secondary>AFS compared to UNIX</secondary>
217               </indexterm>
218
219               <indexterm>
220                 <primary>commands</primary>
221                 <secondary>chown (AFS compared to UNIX)</secondary>
222               </indexterm>
223
224               <para>Only members of the <emphasis
225               role="bold">system:administrators</emphasis> group can issue
226               this command on AFS files.</para>
227             </listitem>
228           </varlistentry>
229
230           <varlistentry>
231             <term><emphasis role="bold">The chgrp
232             command</emphasis></term>
233
234             <listitem>
235               <indexterm>
236                 <primary>chgrp command</primary>
237                 <secondary>AFS compared to UNIX</secondary>
238               </indexterm>
239
240               <indexterm>
241                 <primary>commands</primary>
242                 <secondary>chgrp (AFS compared to UNIX)</secondary>
243               </indexterm>
244
245               <para>Only members of the <emphasis
246               role="bold">system:administrators</emphasis> can issue this
247               command on AFS files and directories.</para>
248             </listitem>
249           </varlistentry>
250
251           <varlistentry>
252             <term><emphasis role="bold">The groups and id
253             commands</emphasis></term>
254
255             <listitem>
256               <indexterm>
257                 <primary>groups command</primary>
258                 <secondary>AFS compared to UNIX</secondary>
259               </indexterm>
260
261               <indexterm>
262                 <primary>id command</primary>
263                 <secondary>AFS compared to UNIX</secondary>
264               </indexterm>
265
266               <indexterm>
267                 <primary>commands</primary>
268                 <secondary>groups (AFS compared to UNIX)</secondary>
269               </indexterm>
270
271               <indexterm>
272                 <primary>commands</primary>
273                 <secondary>id (AFS compared to UNIX)</secondary>
274               </indexterm>
275
276               <para>If the user's AFS tokens are associated with a process
277               authentication group (PAG), the output of these commands may
278               include one or two large numbers. These are artificial
279               groups used by the OpenAFS Cache Manager to track the PAG on
280               some platforms. Other platforms may use other methods, such
281               as native kernel support for a PAG or a similar concept, in
282               which case the large GIDs may not appear. To learn about
283               PAGs, see <link linkend="HDRWQ64">Identifying AFS Tokens by
284               PAG</link>.</para>
285             </listitem>
286           </varlistentry>
287
288           <varlistentry>
289             <term><emphasis role="bold">The ln command</emphasis></term>
290
291             <listitem>
292               <indexterm>
293                 <primary>ln command</primary>
294                 <secondary>AFS compared to UNIX</secondary>
295               </indexterm>
296
297               <indexterm>
298                 <primary>commands</primary>
299                 <secondary>ln (AFS compared to UNIX)</secondary>
300               </indexterm>
301
302               <para>This command cannot create hard links between files in
303               different AFS directories. See <link
304               linkend="HDRWQ32">Creating Hard Links</link>.</para>
305             </listitem>
306           </varlistentry>
307
308           <varlistentry>
309             <term><emphasis role="bold">The sshd daemon and ssh
310             command</emphasis></term>
311
312             <listitem>
313               <indexterm>
314                 <primary>sshd command</primary>
315                 <secondary>AFS compared to UNIX</secondary>
316               </indexterm>
317
318               <indexterm>
319                 <primary>commands</primary>
320                 <secondary>sshd (AFS compared to UNIX)</secondary>
321               </indexterm>
322
323               <indexterm>
324                 <primary>ssh command</primary>
325                 <secondary>AFS compared to UNIX</secondary>
326               </indexterm>
327
328               <indexterm>
329                 <primary>commands</primary>
330                 <secondary>ssh (AFS compared to UNIX)</secondary>
331               </indexterm>
332
333               <para>In order for a user to have access to files stored in
334               AFS, that user needs to have Kerberos tickets and an AFS token
335               on the system from which they're accessing AFS. This has an
336               implication for users who log in remotely via protocols such
337               as Secure Shell (SSH): that log-in process must create local
338               Kerberos tickets and an AFS token on the system, or the user
339               will have to separately authenticate to Kerberos and AFS
340               after logging in.</para>
341
342               <para>The <ulink url="http://www.openssh.org/">OpenSSH
343               project</ulink> provides an SSH client and server that uses
344               the GSS-API protocol to pass Kerberos tickets between
345               machines. With a suitable SSH client, this allows users to
346               delegate their Kerberos tickets to the remote machine, and
347               that machine to store those tickets and obtain AFS tokens as
348               part of the log-in process.</para>
349             </listitem>
350           </varlistentry>
351         </variablelist>
352       </para>
353
354       <indexterm>
355         <primary>fsck command</primary>
356
357         <secondary>AFS compared to UNIX</secondary>
358       </indexterm>
359
360       <indexterm>
361         <primary>file server machine</primary>
362         <secondary>inode-based</secondary>
363       </indexterm>
364
365       <indexterm>
366         <primary>file server machine</primary>
367         <secondary>namei-based</secondary>
368       </indexterm>
369
370       <indexterm>
371         <primary>namei</primary>
372         <secondary>definition</secondary>
373       </indexterm>
374
375       <indexterm>
376         <primary>commands</primary>
377
378         <secondary>fsck (AFS compared to UNIX)</secondary>
379       </indexterm>
380
381       <indexterm>
382         <primary>fsck command</primary>
383
384         <secondary>AFS version</secondary>
385       </indexterm>
386
387       <indexterm>
388         <primary>commands</primary>
389
390         <secondary>fsck (AFS version)</secondary>
391       </indexterm>
392
393       <indexterm>
394         <primary>directories</primary>
395
396         <secondary>lost+found</secondary>
397       </indexterm>
398
399       <indexterm>
400         <primary>lost+found directory</primary>
401       </indexterm>
402     </sect2>
403
404     <sect2 id="Header_38">
405       <title>The AFS version of the fsck Command and inode-based
406       fileservers</title>
407
408       <sidebar>
409         <para>The fileserver uses either of two formats for storing data
410         on disk. The inode-based format uses a combination of regular
411         files and extra fields stored in the inode data structures that
412         are normally reserved for use by the operating system. The namei
413         format uses normal file storage and does not use special
414         structures. The choice of storage formats is chosen at compile
415         time and the two formats are incompatible. The inode format is
416         only available on certain platforms. The storage format must be
417         consistent for the fileserver binaries and all vice partitions on
418         a given file server machine.</para>
419       </sidebar>
420
421       <important>
422         <para>This section on fsck advice only applies to the inode-based
423         fileserver binaries. On servers using namei-based binaries, the
424         vendor-supplied fsck can be used as normal.</para>
425       </important>
426
427       <para>If you are using AFS fileserver binaries compiled with the
428       inode-based format, never run the standard UNIX <emphasis
429       role="bold">fsck</emphasis> command on an AFS file server
430       machine. It does not understand how the File Server organizes volume
431       data on disk, and so moves all AFS data into the <emphasis
432       role="bold">lost+found</emphasis> directory on the partition.</para>
433
434       <para>Instead, use the version of the <emphasis
435       role="bold">fsck</emphasis> program that is included in the AFS
436       distribution.  The <emphasis>OpenAFS Quick Start Guide</emphasis>
437       explains how to replace the vendor-supplied <emphasis
438       role="bold">fsck</emphasis> program with the AFS version as you
439       install each server machine.</para>
440
441       <para>The AFS version functions like the standard <emphasis
442       role="bold">fsck</emphasis> program on data stored on both UFS and
443       AFS partitions. The appearance of a banner like the following as the
444       <emphasis role="bold">fsck</emphasis> program initializes confirms
445       that you are running the correct one:</para>
446
447 <programlisting>
448    --- AFS (R) version fsck---
449 </programlisting>
450
451       <para>where <emphasis>version</emphasis> is the AFS version. For
452       correct results, it must match the AFS version of the server
453       binaries in use on the machine.</para>
454
455       <para>If you ever accidentally run the standard version of the
456       program, contact your AFS support provider, contact the OpenAFS
457       mailing lists, or refer to the <ulink
458       url="http://www.openafs.org/support.html">OpenAFS support web
459       page</ulink> for support options. It is sometimes possible to
460       recover volume data from the <emphasis
461       role="bold">lost+found</emphasis> directory. If the data is not
462       recoverabled, then restoring from backup is recommended.</para>
463
464       <warning>
465         <para>Running the fsck binary supplied by the operating system
466         vendor on an fileserver using inode-based file storage will result
467         in data corruption!</para>
468       </warning>
469     </sect2>
470
471     <sect2 id="HDRWQ32">
472       <title>Creating Hard Links</title>
473
474       <indexterm>
475         <primary>hard link</primary>
476
477         <secondary>AFS restrictions on</secondary>
478       </indexterm>
479
480       <indexterm>
481         <primary>restrictions</primary>
482
483         <secondary>on hard links in AFS</secondary>
484       </indexterm>
485
486       <para>AFS does not allow hard links (created with the UNIX <emphasis
487       role="bold">ln</emphasis> command) between files that reside in
488       different directories, because in that case it is unclear which of
489       the directory's ACLs to associate with the link.</para>
490
491       <para>AFS also does not allow hard links to directories, in order to
492       keep the file system organized as a tree.</para>
493
494       <para>It is possible to create symbolic links (with the UNIX
495       <emphasis role="bold">ln -s</emphasis> command) between elements in
496       two different AFS directories, or even between an element in AFS and
497       one in a machine's local UNIX file system. Do not create a symbolic
498       link in AFS to a file whose name begins with either a number sign
499       (<emphasis role="bold">#</emphasis>) or a percent sign (<emphasis
500       role="bold">%</emphasis>), however. The Cache Manager interprets
501       such links as a mount point to a regular or read/write volume,
502       respectively.</para>
503     </sect2>
504
505     <sect2 id="HDRWQ33">
506       <title>AFS Implements Save on Close</title>
507
508       <indexterm>
509         <primary>fsync system call</primary>
510
511         <secondary>for files saved on AFS client</secondary>
512       </indexterm>
513
514       <indexterm>
515         <primary>close system call</primary>
516
517         <secondary>for files saved on AFS client</secondary>
518       </indexterm>
519
520       <indexterm>
521         <primary>write</primary>
522
523         <secondary>system call for files saved on AFS client</secondary>
524       </indexterm>
525
526       <para>When an application issues the UNIX <emphasis
527       role="bold">close</emphasis> system call on a file, the Cache
528       Manager performs a synchronous write of the data to the File Server
529       that maintains the central copy of the file. It does not return
530       control to the application until the File Server has acknowledged
531       receipt of the data. For the <emphasis role="bold">fsync</emphasis>
532       system call, control does not return to the application until the
533       File Server indicates that it has written the data to non-volatile
534       storage on the file server machine.</para>
535
536       <para>When an application issues the UNIX <emphasis
537       role="bold">write</emphasis> system call, the Cache Manager writes
538       modifications to the local AFS client cache only. If the local
539       machine crashes or an application program exits without issuing the
540       <emphasis role="bold">close</emphasis> system call, it is possible
541       that the modifications are not recorded in the central copy of the
542       file maintained by the File Server. The Cache Manager does sometimes
543       write this type of modified data from the cache to the File Server
544       without receiving the <emphasis role="bold">close</emphasis> or
545       <emphasis role="bold">fsync</emphasis> system call, such as when it
546       needs to free cache chunks for new data. However, it is not
547       generally possible to predict when the Cache Manager transfers
548       modified data to the File Server in this way.</para>
549
550       <para>The implication is that if an application's <emphasis
551       role="bold">Save</emphasis> option invokes the <emphasis
552       role="bold">write</emphasis> system call rather than <emphasis
553       role="bold">close</emphasis> or <emphasis
554       role="bold">fsync</emphasis>, the changes are not necessarily stored
555       permanently on the File Server machine. Most application programs
556       issue the <emphasis role="bold">close</emphasis> system call for
557       save operations, as well as when they finish handling a file and
558       when they exit.</para>
559     </sect2>
560
561     <sect2 id="Header_41">
562       <title>Setuid Programs</title>
563
564       <indexterm>
565         <primary>setuid programs</primary>
566
567         <secondary>restrictions on</secondary>
568       </indexterm>
569
570       <para>The UNIX setuid bit is ignored by default for programs run
571       from AFS, but can be enabled by the system administrator on a client
572       machine. The <emphasis role="bold">fs setcell</emphasis> command
573       determines whether setuid programs that originate in a particular
574       cell can run on a given client machine. Running setuid binaries from
575       AFS poses a security risk due to weaknesses in the integrity checks
576       of the AFS protocol and should normally not be permitted. See <link
577       linkend="HDRWQ409">Determining if a Client Can Run Setuid
578       Programs</link>.</para>
579
580       <para>Set the UNIX setuid bit only for files whose owner is UID 0
581       (the local superuser <emphasis role="bold">root</emphasis>). This
582       does not present an automatic security risk: the local superuser has
583       no special privilege in AFS, but only in the local machine's UNIX
584       file system and kernel. Setting the UNIX setuid bit for files owned
585       with a different UID will have unpredictable resuilts, since that
586       UID will be interpreted as possibly different users on each AFS
587       client machine.</para>
588
589       <para>Any file can be marked with the setuid bit, but only members
590       of the <emphasis role="bold">system:administrators</emphasis> group
591       can issue the <emphasis role="bold">chown</emphasis> system call or
592       the <emphasis role="bold">chown</emphasis> command, or issue the
593       <emphasis role="bold">chmod</emphasis> system call or the <emphasis
594       role="bold">chmod</emphasis> command to set the setuid bit.</para>
595     </sect2>
596   </sect1>
597
598   <sect1 id="HDRWQ34">
599     <title>Choosing a Cell Name</title>
600
601       <indexterm>
602         <primary>cell</primary>
603
604         <secondary>name</secondary>
605
606         <tertiary>choosing</tertiary>
607       </indexterm>
608
609       <indexterm>
610         <primary>choosing</primary>
611
612         <secondary>name</secondary>
613
614         <tertiary>cell</tertiary>
615       </indexterm>
616
617       <indexterm>
618         <primary>conventions</primary>
619
620         <secondary>cell name</secondary>
621       </indexterm>
622
623       <indexterm>
624         <primary>Internet</primary>
625
626         <secondary>conventions for cell name</secondary>
627       </indexterm>
628
629     <para>This section explains how to choose a cell name and explains why
630     choosing an appropriate cell name is important.</para>
631
632     <para>Your cell name must distinguish your cell from all others in the
633     AFS global namespace. By convention, the cell name is the second
634     element in any AFS pathname; therefore, a unique cell name guarantees
635     that every AFS pathname uniquely identifies a file, even if cells use
636     the same directory names at lower levels in their local AFS
637     filespace. For example, both the Example Corporation cell and the Example
638     Organization cell can have a home directory for the user <emphasis
639     role="bold">pat</emphasis>, because the pathnames are distinct:
640     <emphasis role="bold">/afs/example.com/usr/pat</emphasis> and <emphasis
641     role="bold">/afs/example.org/usr/pat</emphasis>.</para>
642
643     <para>By convention, cell names follow the Domain Name System (DNS)
644     conventions for domain names. If you are already an Internet site,
645     then it is simplest and strongly recommended to choose your Internet
646     domain name as the cell name.</para>
647
648     <para>If you are not an Internet site, it is best to choose a unique
649     DNS-style name, particularly if you plan to connect to the Internet in
650     the future. There are a few constraints on AFS cell names:
651       <itemizedlist>
652         <listitem>
653           <para>It can contain as many as 64 characters, but shorter names
654           are better because the cell name frequently is part of machine
655           and file names. If your cell name is long, you can reduce
656           pathname length either by creating a symbolic link to the
657           complete cell name, at the second level in your file tree or by
658           using the <emphasis role="bold">CellAlias</emphasis>
659           configuration file on a client machine. See <link
660           linkend="HDRWQ42">The Second (Cellname) Level</link>.</para>
661         </listitem>
662
663         <listitem>
664           <para>To guarantee it is suitable for different operating system
665           types, the cell name can contain only lowercase characters,
666           numbers, underscores, dashes, and periods. Do not include
667           command shell metacharacters.</para>
668         </listitem>
669
670         <listitem>
671           <para>It can include any number of fields, which are
672           conventionally separated by periods (see the examples
673           below).</para>
674         </listitem>
675       </itemizedlist>
676     </para>
677
678     <sect2 id="Header_43">
679       <title>How to Set the Cell Name</title>
680
681       <indexterm>
682         <primary>setting</primary>
683         <secondary>cell name</secondary>
684       </indexterm>
685
686       <indexterm>
687         <primary>cell</primary>
688         <secondary>name</secondary>
689         <tertiary>setting</tertiary>
690       </indexterm>
691
692       <indexterm>
693         <primary>server machine</primary>
694         <secondary>setting home cell</secondary>
695       </indexterm>
696
697       <indexterm>
698         <primary>client machine</primary>
699         <secondary>setting home cell</secondary>
700       </indexterm>
701
702       <para>The cell name is recorded in two files on the local disk of
703       each file server and client machine. Among other functions, these
704       files define the machine's cell membership and so affect how
705       programs and processes run on the machine; see <link
706       linkend="HDRWQ35">Why Choosing the Appropriate Cell Name is
707       Important</link>. The procedure for setting the cell name is
708       different for the two types of machines.</para>
709
710       <para>For file server machines, the two files that record the cell
711       name are the <emphasis role="bold">/usr/afs/etc/ThisCell</emphasis>
712       and <emphasis role="bold">/usr/afs/etc/CellServDB</emphasis>
713       files. As described more explicitly in the <emphasis>OpenAFS Quick
714       Start Guide</emphasis>, you set the cell name in both by issuing the
715       <emphasis role="bold">bos setcellname</emphasis> command on the
716       first file server machine you install in your cell. It is not
717       usually necessary to issue the command again. If you use the Update
718       Server, it distributes its copy of the <emphasis
719       role="bold">ThisCell</emphasis> and <emphasis
720       role="bold">CellServDB</emphasis> files to additional server
721       machines that you install. If you do not use the Update Server, the
722       <emphasis>OpenAFS Quick Start Guide</emphasis> explains how to copy
723       the files manually.</para>
724
725       <para>For client machines, the two files that record the cell name
726       are the <emphasis role="bold">/usr/vice/etc/ThisCell</emphasis> and
727       <emphasis role="bold">/usr/vice/etc/CellServDB</emphasis> files. You
728       create these files on a per-client basis, either with a text editor
729       or by copying them onto the machine from a central source in AFS.
730       See <link linkend="HDRWQ406">Maintaining Knowledge of Database
731       Server Machines</link> for details.</para>
732
733       <para>Change the cell name in these files only when you want to
734       transfer the machine to a different cell (client machines can only
735       have one default cell at a time and server machines can only belong
736       to one cell at a time). If the machine is a file server, follow the
737       complete set of instructions in the <emphasis>OpenAFS Quick Start
738       Guide</emphasis> for configuring a new cell. If the machine is a
739       client, all you need to do is change the files appropriately and
740       reboot the machine. The next section explains further the negative
741       consequences of changing the name of an existing cell.</para>
742
743       <para>To set the default cell name used by most AFS commands without
744       changing the local <emphasis
745       role="bold">/usr/vice/etc/ThisCell</emphasis> file, set the AFSCELL
746       environment variable in the command shell. It is worth setting this
747       variable if you need to complete significant administrative work in
748       a foreign cell.</para>
749
750       <note>
751         <para>The <emphasis role="bold">fs checkservers</emphasis> and
752         <emphasis role="bold">fs mkmount</emphasis> commands do not use
753         the AFSCELL variable. The <emphasis role="bold">fs
754         checkservers</emphasis> command always defaults to the cell named
755         in the <emphasis role="bold">ThisCell</emphasis> file, unless the
756         <emphasis role="bold">-cell</emphasis> argument is used. The
757         <emphasis role="bold">fs mkmount</emphasis> command defaults to
758         the cell in which the parent directory of the new mount point
759         resides.</para>
760       </note>
761     </sect2>
762
763     <sect2 id="HDRWQ35">
764       <title>Why Choosing the Appropriate Cell Name is Important</title>
765
766       <indexterm>
767         <primary>ThisCell file (client)</primary>
768         <secondary>how used by programs</secondary>
769       </indexterm>
770
771       <para>Take care to select a cell name that is suitable for long-term
772       use. Changing a cell name later is complicated. An appropriate cell
773       name is important because it is the second element in the pathname
774       of all files in a cell's file tree.  Because each cell name is
775       unique, its presence in an AFS pathname makes the pathname unique in
776       the AFS global namespace, even if multiple cells use similar
777       filespace organization at lower levels. For instance, it means that
778       every cell can have a home directory called <emphasis
779       role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
780       role="bold">/usr/pat</emphasis> without causing a conflict. The
781       presence of the cell name in pathnames also means that users in
782       every cell use the same pathname to access a file, whether the file
783       resides in their local cell or in a foreign cell.</para>
784
785       <para>Another reason to choose the correct cell name early in the
786       process of installing your cell is that the cell membership defined
787       in each machine's <emphasis role="bold">ThisCell</emphasis> file
788       affects the performance of many programs and processes running on
789       the machine. For instance, AFS commands (<emphasis
790       role="bold">fs</emphasis>, <emphasis role="bold">pts</emphasis>, and
791       <emphasis role="bold">vos</emphasis> commands, for example) by
792       default execute in the cell of the machine on which they are
793       issued. The command interpreters check the <emphasis
794       role="bold">ThisCell</emphasis> file on the local disk and then
795       contact the database server machines listed in the <emphasis
796       role="bold">CellServDB</emphasis> file or configured in DNS for the
797       indicated cell. (The <emphasis role="bold">bos</emphasis> commands
798       work differently because the issuer always has to name of the
799       machine on which to run the command.)</para>
800
801       <para>The <emphasis role="bold">ThisCell</emphasis> file also
802       normally determines the cell for which a user receives an AFS token
803       when he or she logs in to a machine.</para>
804
805       <para>If you change the cell name, you must change the <emphasis
806       role="bold">ThisCell</emphasis> and <emphasis
807       role="bold">CellServDB</emphasis> files on every server and client
808       machine. Failure to change them all will cause many commands from
809       the AFS suites to not work as expected.</para>
810     </sect2>
811   </sect1>
812
813   <sect1 id="HDRWQ36">
814     <title>Participating in the AFS Global Namespace</title>
815
816     <indexterm>
817       <primary>participation</primary>
818       <secondary>in AFS global namespace</secondary>
819     </indexterm>
820
821     <indexterm>
822       <primary>AFS</primary>
823       <secondary>global namespace</secondary>
824     </indexterm>
825
826     <indexterm>
827       <primary>global namespace</primary>
828     </indexterm>
829
830     <para>Participating in the AFS global namespace makes your cell's
831     local file tree visible to AFS users in foreign cells and makes other
832     cells' file trees visible to your local users. It makes file sharing
833     across cells just as easy as sharing within a cell. This section
834     outlines the procedures necessary for participating in the global
835     namespace.
836       <itemizedlist>
837         <listitem>
838           <para>Participation in the global namespace is not
839           mandatory. Some cells use AFS primarily to facilitate file
840           sharing within the cell, and are not interested in providing
841           their users with access to foreign cells.</para>
842         </listitem>
843
844         <listitem>
845           <para>Making your file tree visible does not mean making it
846           vulnerable. You control how foreign users access your cell using
847           the same protection mechanisms that control local users'
848           access. See <link linkend="HDRWQ40">Granting and Denying Foreign
849           Users Access to Your Cell</link>.</para>
850         </listitem>
851
852         <listitem>
853           <para>The two aspects of participation are independent. A cell
854           can make its file tree visible without allowing its users to see
855           foreign cells' file trees, or can enable its users to see other
856           file trees without advertising its own.</para>
857         </listitem>
858
859         <listitem>
860           <para>You make your cell visible to others by advertising your
861           database server machines and allowing users at other sites to
862           access your database server and file server machines. See <link
863           linkend="HDRWQ38">Making Your Cell Visible to
864           Others</link>.</para>
865         </listitem>
866
867         <listitem>
868           <para>You control access to foreign cells on a per-client
869           machine basis. In other words, it is possible to make a foreign
870           cell accessible from one client machine in your cell but not
871           another. See <link linkend="HDRWQ39">Making Other Cells Visible
872           in Your Cell</link>.</para>
873         </listitem>
874       </itemizedlist>
875     </para>
876
877     <sect2 id="HDRWQ37">
878       <title>What the Global Namespace Looks Like</title>
879
880       <indexterm>
881         <primary>conventions</primary>
882         <secondary>AFS pathnames</secondary>
883       </indexterm>
884
885       <indexterm>
886         <primary>AFS</primary>
887         <secondary>root directory (/afs)</secondary>
888         <tertiary>on client machine</tertiary>
889       </indexterm>
890
891       <indexterm>
892         <primary>directories</primary>
893         <secondary>/afs</secondary>
894       </indexterm>
895
896       <indexterm>
897         <primary>directories</primary>
898         <secondary>/afs/<emphasis>cellname</emphasis></secondary>
899       </indexterm>
900
901       <indexterm>
902         <primary>cell</primary>
903         <secondary>name</secondary>
904         <tertiary>at second level in file tree</tertiary>
905       </indexterm>
906
907       <para>The AFS global namespace appears the same to all AFS cells
908       that participate in it, because they all agree to follow a small set
909       of conventions in constructing pathnames.</para>
910
911       <para>The first convention is that all AFS pathnames begin with the
912       string <emphasis role="bold">/afs</emphasis> to indicate that they
913       belong to the AFS global namespace.</para>
914
915       <para>The second convention is that the cell name is the second
916       element in an AFS pathname; it indicates where the file resides
917       (that is, the cell in which a file server machine houses the
918       file). As noted, the presence of a cell name in pathnames makes the
919       global namespace possible, because it guarantees that all AFS
920       pathnames are unique even if cells use the same directory names at
921       lower levels in their AFS filespace.</para>
922
923       <para>What appears at the third and lower levels in an AFS pathname
924       depends on how a cell has chosen to arrange its filespace.  There
925       are some suggested conventional directories at the third level; see
926       <link linkend="HDRWQ43">The Third Level</link>.</para>
927     </sect2>
928
929     <sect2 id="HDRWQ38">
930       <title>Making Your Cell Visible to Others</title>
931
932       <indexterm>
933         <primary>cell</primary>
934         <secondary>making local visible to foreign</secondary>
935       </indexterm>
936
937       <indexterm>
938         <primary>local cell</primary>
939         <secondary>making visible to foreign cells</secondary>
940       </indexterm>
941
942       <indexterm>
943         <primary>foreign cell</primary>
944         <secondary>making local cell visible</secondary>
945       </indexterm>
946
947       <para>You make your cell visible to others by advertising your cell
948       name and database server machines. Just like client machines in the
949       local cell, the Cache Manager on machines in foreign cells use the
950       information to reach your cell's Volume Location (VL) Servers when
951       they need volume and file location information. For authenticated
952       access, foreign clients must be configured with the necessary
953       Kerberos version 5 domain-to-realm mappings and Key Distribution
954       Center (KDC) location information for both the local and remote
955       Kerberos version 5 realms.</para>
956
957       <para>There are two places you can make this information available:
958       <itemizedlist>
959           <indexterm>
960             <primary>files</primary>
961
962             <secondary>global CellServDB</secondary>
963           </indexterm>
964
965           <indexterm>
966             <primary>CellServDB file maintained by the AFS
967             Registrar</primary>
968
969             <secondary>as global update source</secondary>
970           </indexterm>
971
972           <listitem>
973             <para>In the global <emphasis
974             role="bold">CellServDB</emphasis> file maintained by the AFS
975             Registrar. This file lists the name and database server
976             machines of every cell that has agreed to make this
977             information available to other cells. This file is available
978             at <ulink
979             url="http://grand.central.org/csdb.html">http://grand.central.org/csdb.html</ulink></para>
980
981             <para>To add or change your cell's listing in this file,
982               follow the instructions at <ulink
983               url="http://grand.central.org/csdb.html">http://grand.central.org/csdb.html</ulink>.
984               It is a good policy to check the file for changes on a
985               regular schedule. An updated copy of this file is included
986               with new releases of OpenAFS.</para>
987
988             <indexterm>
989               <primary>files</primary>
990
991               <secondary>CellServDB.local</secondary>
992             </indexterm>
993
994             <indexterm>
995               <primary>CellServDB.local file</primary>
996             </indexterm>
997           </listitem>
998
999           <listitem>
1000             <para>A file called <emphasis
1001             role="bold">CellServDB.local</emphasis> in the <emphasis
1002             role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1003             role="bold">/service/etc</emphasis> directory of your cell's
1004             filespace. List only your cell's database server
1005             machines.</para>
1006           </listitem>
1007       </itemizedlist>
1008       </para>
1009
1010       <para>Update the files whenever you change the identity of your
1011       cell's database server machines. Also update the copies of the
1012       <emphasis role="bold">CellServDB</emphasis> files on all of your
1013       server machines (in the <emphasis
1014       role="bold">/usr/afs/etc</emphasis> directory) and client machines
1015       (in the <emphasis role="bold">/usr/vice/etc</emphasis>
1016       directory). For instructions, see <link
1017       linkend="HDRWQ118">Maintaining the Server CellServDB File</link> and
1018       <link linkend="HDRWQ406">Maintaining Knowledge of Database Server
1019       Machines</link>.</para>
1020
1021       <para>Once you have advertised your database server machines, it can
1022       be difficult to make your cell invisible again. You can remove the
1023       <emphasis role="bold">CellServDB.local</emphasis> file and ask the
1024       AFS Registrar to remove your entry from the global <emphasis
1025       role="bold">CellServDB</emphasis> file, but other cells probably
1026       have an entry for your cell in their local <emphasis
1027       role="bold">CellServDB</emphasis> files already. To make those
1028       entries invalid, you must change the names or IP addresses of your
1029       database server machines.</para>
1030
1031       <para>Your cell does not have to be invisible to be inaccessible,
1032       however. To make your cell completely inaccessible to foreign users,
1033       remove the <emphasis role="bold">system:anyuser</emphasis> group
1034       from all ACLs at the top three levels of your filespace; see <link
1035       linkend="HDRWQ40">Granting and Denying Foreign Users Access to Your
1036       Cell</link>.</para>
1037
1038       <indexterm>
1039         <primary>cell</primary>
1040
1041         <secondary>making foreign visible to local</secondary>
1042       </indexterm>
1043
1044       <indexterm>
1045         <primary>local cell</primary>
1046
1047         <secondary>making foreign cells visible in</secondary>
1048       </indexterm>
1049
1050       <indexterm>
1051         <primary>foreign cell</primary>
1052
1053         <secondary>making visible in local cell</secondary>
1054       </indexterm>
1055
1056       <indexterm>
1057         <primary>client machine</primary>
1058
1059         <secondary>making foreign cell visible</secondary>
1060       </indexterm>
1061     </sect2>
1062
1063     <sect2 id="HDRWQ39">
1064       <title>Making Other Cells Visible in Your Cell</title>
1065
1066       <para>To make a foreign cell's filespace visible on a client machine
1067       in your cell that is not configured for <emphasis
1068       role="bold">Freelance Mode</emphasis> or <emphasis
1069       role="bold">Dynamic Root</emphasis> mode, perform the following
1070       three steps:
1071       <orderedlist>
1072           <listitem>
1073             <para>Mount the cell's <emphasis
1074             role="bold">root.cell</emphasis> volume at the second level in
1075             your cell's filespace just below the <emphasis
1076             role="bold">/afs</emphasis> directory. Use the <emphasis
1077             role="bold">fs mkmount</emphasis> command with the <emphasis
1078             role="bold">-cell</emphasis> argument as instructed in <link
1079             linkend="HDRWQ213">To create a cellular mount
1080             point</link>.</para>
1081           </listitem>
1082
1083           <listitem>
1084             <para>Mount AFS at the <emphasis role="bold">/afs</emphasis>
1085             directory on the client machine. The <emphasis
1086             role="bold">afsd</emphasis> program, which initializes the
1087             Cache Manager, performs the mount automatically at the
1088             directory named in the first field of the local <emphasis
1089             role="bold">/usr/vice/etc/cacheinfo</emphasis> file or by the
1090             command's <emphasis role="bold">-mountdir</emphasis>
1091             argument. Mounting AFS at an alternate location makes it
1092             impossible to reach the filespace of any cell that mounts its
1093             <emphasis role="bold">root.afs</emphasis> and <emphasis
1094             role="bold">root.cell</emphasis> volumes at the conventional
1095             locations. See <link linkend="HDRWQ395">Displaying and Setting
1096             the Cache Size and Location</link>.</para>
1097           </listitem>
1098
1099           <listitem>
1100             <para>Create an entry for the cell in the list of database
1101             server machines which the Cache Manager maintains in kernel
1102             memory.</para>
1103
1104             <para>The <emphasis
1105             role="bold">/usr/vice/etc/CellServDB</emphasis> file on every
1106             client machine's local disk lists the database server machines
1107             for the local and foreign cells. The <emphasis
1108             role="bold">afsd</emphasis> program reads the contents of the
1109             <emphasis role="bold">CellServDB</emphasis> file into kernel
1110             memory as it initializes the Cache Manager.  You can also use
1111             the <emphasis role="bold">fs newcell</emphasis> command to add
1112             or alter entries in kernel memory directly between reboots of
1113             the machine. See <link linkend="HDRWQ406">Maintaining
1114             Knowledge of Database Server Machines</link>.</para>
1115           </listitem>
1116       </orderedlist>
1117       </para>
1118
1119       <para>Non-windows client machines may enable <emphasis
1120       role="bold">Dynamic Root Mode</emphasis> by using the <emphasis
1121       role="bold">-dynroot</emphasis> option to <emphasis
1122       role="bold">afsd</emphasis>. When this option is enabled, all cells
1123       listed in the <emphasis role="bold">CellServDB</emphasis> file will
1124       appear in the <emphasis role="bold">/afs</emphasis> directory. The
1125       contents of the <emphasis role="bold">root.afs</emphasis> volume
1126       will be ignored.  </para>
1127
1128       <para>Windows client machines may enable <emphasis
1129       role="bold">Freelance Mode</emphasis> during client installation or
1130       by setting the <emphasis role="bold">FreelanceClient</emphasis>
1131       setting under <emphasis role="bold">Service Parameters</emphasis> in
1132       the Windows Registry as mentioned in the <ulink
1133       url="http://docs.openafs.org/ReleaseNotesWindows/">Release
1134       Notes</ulink>.  When this option is enabled, the <emphasis
1135       role="bold">root.afs</emphasis> volume is ignored and a mounpoint
1136       for each cell is automatically created in the the <emphasis
1137       role="bold">\\AFS</emphasis> directory when the folder <emphasis
1138       role="bold">\\AFS\<replaceable>cellname</replaceable></emphasis> is
1139       accessed and the foreign Volume Location servers can be reached.
1140       </para> <para>Note that making a foreign cell visible to client
1141       machines does not guarantee that your users can access its
1142       filespace.  The ACLs in the foreign cell must also grant them the
1143       necessary permissions.</para>
1144
1145       <indexterm>
1146         <primary>cell</primary>
1147
1148         <secondary>granting local access to foreign users</secondary>
1149       </indexterm>
1150
1151       <indexterm>
1152         <primary>local cell</primary>
1153
1154         <secondary>granting foreign users access to</secondary>
1155       </indexterm>
1156     </sect2>
1157
1158     <sect2 id="HDRWQ40">
1159       <title>Granting and Denying Foreign Users Access to Your
1160       Cell</title>
1161
1162       <para>Making your cell visible in the AFS global namespace does not
1163       take away your control over the way in which users from foreign
1164       cells access your file tree.</para>
1165
1166       <para>By default, foreign users access your cell as the user
1167       <emphasis role="bold">anonymous</emphasis>, which means they have
1168       only the permissions granted to the <emphasis
1169       role="bold">system:anyuser</emphasis> group on each directory's
1170       ACL. Normally these permissions are limited to the <emphasis
1171       role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>)
1172       and <emphasis role="bold">r</emphasis> (<emphasis
1173       role="bold">read</emphasis>) permissions.</para>
1174
1175       <para>There are three ways to grant wider access to foreign users:
1176       <itemizedlist>
1177           <listitem>
1178             <para>Grant additional permissions to the <emphasis
1179             role="bold">system:anyuser</emphasis> group on certain
1180             ACLs. Keep in mind, however, that all users can then access
1181             that directory in the indicated way (not just specific foreign
1182             users you have in mind).</para>
1183           </listitem>
1184
1185           <listitem>
1186             <para>Enable automatic registration for users in the foreign
1187             cell. This may be done by creating a cross-realm trust in the
1188             <emphasis role="bold">Kerberos Database</emphasis>. Then add a
1189             PTS group named <emphasis
1190             role="bold">system:authuser<replaceable>@FOREIGN.REALM</replaceable></emphasis>
1191             and give it a group quota greater than the number of foreign
1192             users expected to be registered. After the cross-realm trust
1193             and the PTS group are created, the <ulink
1194             url="http://docs.openafs.org/Reference/1/aklog.html">aklog</ulink>
1195             command will automatically register foreign users as
1196             needed. Consult the documentation for your <emphasis
1197             role="bold">Kerberos Server</emphasis> for instructions on how
1198             to establish a cross-realm trust.  </para>
1199           </listitem>
1200
1201           <listitem>
1202             <para>Create a local authentication account for specific
1203             foreign users, by creating entries in the Protection Database,
1204             the Kerberos Database, and the local password file.</para>
1205           </listitem>
1206       </itemizedlist>
1207       </para>
1208
1209       <indexterm>
1210         <primary>cell</primary>
1211
1212         <secondary>filespace configuration issues</secondary>
1213       </indexterm>
1214
1215       <indexterm>
1216         <primary>configuring</primary>
1217
1218         <secondary>filespace, issues</secondary>
1219       </indexterm>
1220
1221       <indexterm>
1222         <primary>file tree</primary>
1223
1224         <secondary>conventions</secondary>
1225
1226         <tertiary>for configuring</tertiary>
1227       </indexterm>
1228     </sect2>
1229   </sect1>
1230
1231   <sect1 id="HDRWQ41">
1232     <title>Configuring Your AFS Filespace</title>
1233
1234     <para>This section summarizes the issues to consider when configuring
1235     your AFS filespace. For a discussion of creating volumes that
1236     correspond most efficiently to the filespace's directory structure,
1237     see <link linkend="HDRWQ44">Creating Volumes to Simplify
1238     Administration</link>.</para>
1239
1240     <note>
1241       <para><emphasis role="bold">For Windows users:</emphasis> Windows
1242       uses a backslash (<emphasis role="bold">\</emphasis>) rather than a
1243       forward slash (<emphasis role="bold">/</emphasis>) to separate the
1244       elements in a pathname. The hierarchical organization of the
1245       filespace is however the same as on a UNIX machine.</para>
1246     </note>
1247
1248     <para>AFS pathnames must follow a few conventions so the AFS global
1249     namespace looks the same from any AFS client machine. There are
1250     corresponding conventions to follow in building your file tree, not
1251     just because pathnames reflect the structure of a file tree, but also
1252     because the AFS Cache Manager expects a certain configuration.</para>
1253
1254     <indexterm>
1255       <primary>AFS</primary>
1256
1257       <secondary>root directory (/afs)</secondary>
1258
1259       <tertiary>in cell filespace</tertiary>
1260     </indexterm>
1261
1262     <indexterm>
1263       <primary>directories</primary>
1264
1265       <secondary>/afs</secondary>
1266     </indexterm>
1267
1268     <sect2 id="Header_51">
1269       <title>The Top /afs Level</title>
1270
1271       <para>The first convention is that the top level in your file tree
1272       be called the <emphasis role="bold">/afs</emphasis> directory. If
1273       you name it something else, then you must use the <emphasis
1274       role="bold">-mountdir</emphasis> argument with the <emphasis
1275       role="bold">afsd</emphasis> program to get Cache Managers to mount
1276       AFS properly. You cannot participate in the AFS global namespace in
1277       that case.</para>
1278
1279       <indexterm>
1280         <primary>cell</primary>
1281
1282         <secondary>name</secondary>
1283
1284         <tertiary>at second level in file tree</tertiary>
1285       </indexterm>
1286
1287       <indexterm>
1288         <primary>directories</primary>
1289
1290         <secondary>/afs/<emphasis>cellname</emphasis></secondary>
1291       </indexterm>
1292
1293       <indexterm>
1294         <primary>symbolic link</primary>
1295
1296         <secondary>at second level of AFS pathname</secondary>
1297       </indexterm>
1298     </sect2>
1299
1300     <sect2 id="HDRWQ42">
1301       <title>The Second (Cellname) Level</title>
1302
1303       <para>The second convention is that just below the <emphasis
1304       role="bold">/afs</emphasis> directory you place directories
1305       corresponding to each cell whose file tree is visible and accessible
1306       from the local cell. Minimally, there must be a directory for the
1307       local cell. Each such directory is a mount point to the indicated
1308       cell's <emphasis role="bold">root.cell</emphasis> volume. For
1309       example, in the Example Corporation cell, <emphasis
1310       role="bold">/afs/example.com</emphasis> is a mount point for the cell's
1311       own <emphasis role="bold">root.cell</emphasis> volume and <emphasis
1312       role="bold">example.org</emphasis> is a mount point for the Example
1313       Organization cell's <emphasis role="bold">root.cell</emphasis>
1314       volume. The <emphasis role="bold">fs lsmount</emphasis> command
1315       displays the mount points.</para>
1316
1317 <programlisting>
1318    % <emphasis role="bold">fs lsmount /afs/example.com</emphasis>
1319    '/afs/example.com' is a mount point for volume '#root.cell'
1320    % <emphasis role="bold">fs lsmount /afs/example.org</emphasis>
1321    '/afs/example.org' is a mount point for volume '#example.org:root.cell'
1322 </programlisting>
1323
1324       <para>To reduce the amount of typing necessary in pathnames, you can
1325       create a symbolic link with an abbreviated name to the mount point
1326       of each cell your users frequently access (particularly the home
1327       cell). In the Example Corporation cell, for instance, <emphasis
1328       role="bold">/afs/example</emphasis> is a symbolic link to the <emphasis
1329       role="bold">/afs/example.com</emphasis> mount point, as the <emphasis
1330       role="bold">fs lsmount</emphasis> command reveals.</para>
1331
1332 <programlisting>
1333    % <emphasis role="bold">fs lsmount /afs/example</emphasis>
1334    '/afs/example' is a symbolic link, leading to a mount point for volume
1335 '#root.cell' </programlisting>
1336
1337       <indexterm>
1338         <primary>file tree</primary>
1339
1340         <secondary>conventions</secondary>
1341
1342         <tertiary>third level</tertiary>
1343       </indexterm>
1344
1345       <indexterm>
1346         <primary>directories</primary>
1347
1348         <secondary>conventional under /afs/cellname</secondary>
1349       </indexterm>
1350     </sect2>
1351
1352     <sect2 id="HDRWQ43">
1353       <title>The Third Level</title>
1354
1355       <para>You can organize the third level of your cell's file tree any
1356       way you wish. The following list describes directories that appear
1357       at this level in the conventional configuration:
1358       <variablelist>
1359           <varlistentry>
1360             <term><emphasis role="bold">common</emphasis></term>
1361
1362             <listitem>
1363               <para>This directory contains programs and files needed by
1364               users working on machines of all system types, such as text
1365               editors, online documentation files, and so on. Its
1366               <emphasis role="bold">/etc</emphasis> subdirectory is a
1367               logical place to keep the central update sources for files
1368               used on all of your cell's client machines, such as the
1369               <emphasis role="bold">ThisCell</emphasis> and <emphasis
1370               role="bold">CellServDB</emphasis> files.</para>
1371             </listitem>
1372           </varlistentry>
1373
1374           <varlistentry>
1375             <term><emphasis role="bold">public</emphasis></term>
1376
1377             <listitem>
1378               <para>A directory accessible to anyone who can access your
1379               filespace, because its ACL grants the <emphasis
1380               role="bold">l</emphasis> (<emphasis
1381               role="bold">lookup</emphasis>) and <emphasis
1382               role="bold">r</emphasis> (<emphasis
1383               role="bold">read</emphasis>) permissions to the <emphasis
1384               role="bold">system:anyuser</emphasis> group. It is useful if
1385               you want to enable your users to make selected information
1386               available to everyone, but do not want to grant foreign
1387               users access to the contents of the <emphasis
1388               role="bold">usr</emphasis> directory which houses user home
1389               directories (and is also at this level). It is conventional
1390               to create a subdirectory for each of your cell's
1391               users.</para>
1392             </listitem>
1393           </varlistentry>
1394
1395           <varlistentry>
1396             <term><emphasis role="bold">service</emphasis></term>
1397
1398             <listitem>
1399               <para>This directory contains files and subdirectories that
1400               help cells coordinate resource sharing. For a list of the
1401               proposed standard files and subdirectories to create, call
1402               or write to AFS Product Support.</para>
1403
1404               <para>As an example, files that other cells expect to find
1405               in this directory's <emphasis role="bold">etc</emphasis>
1406               subdirectory can include the following: <itemizedlist>
1407                   <listitem>
1408                     <para><emphasis
1409                     role="bold">CellServDB.export</emphasis>, a list of
1410                     database server machines for many cells</para>
1411                   </listitem>
1412
1413                   <listitem>
1414                     <para><emphasis
1415                     role="bold">CellServDB.local</emphasis>, a list of the
1416                     cell's own database server machines</para>
1417                   </listitem>
1418
1419                   <listitem>
1420                     <para><emphasis role="bold">passwd</emphasis>, a copy
1421                     of the local password file (<emphasis
1422                     role="bold">/etc/passwd</emphasis> or equivalent) kept
1423                     on the local disk of the cell's client machines</para>
1424                   </listitem>
1425
1426                   <listitem>
1427                     <para><emphasis role="bold">group</emphasis>, a copy
1428                     of the local groups file (<emphasis
1429                     role="bold">/etc/group</emphasis> or equivalent) kept
1430                     on the local disk of the cell's client machines</para>
1431                   </listitem>
1432               </itemizedlist>
1433               </para>
1434             </listitem>
1435           </varlistentry>
1436
1437           <varlistentry>
1438             <term><emphasis>sys_type</emphasis></term>
1439
1440             <listitem>
1441               <para>A separate directory for storing the server and client
1442               binaries for each system type you use in the cell.
1443               Configuration is simplest if you use the system type names
1444               assigned in the AFS distribution, particularly if you wish
1445               to use the <emphasis role="bold">@sys</emphasis> variable in
1446               pathnames (see <link linkend="HDRWQ56">Using the @sys
1447               Variable in Pathnames</link>). The <emphasis>OpenAFS Release
1448               Notes</emphasis> lists the conventional name for each
1449               supported system type.</para>
1450
1451               <para>Within each such directory, create directories named
1452               <emphasis role="bold">bin</emphasis>, <emphasis
1453               role="bold">etc</emphasis>, <emphasis
1454               role="bold">usr</emphasis>, and so on, to store the programs
1455               normally kept in the <emphasis role="bold">/bin</emphasis>,
1456               <emphasis role="bold">/etc</emphasis> and <emphasis
1457               role="bold">/usr</emphasis> directories on a local
1458               disk. Then create symbolic links from the local directories
1459               on client machines into AFS; see <link
1460               linkend="HDRWQ55">Configuring the Local Disk</link>. Even if
1461               you do not choose to use symbolic links in this way, it can
1462               be convenient to have central copies of system binaries in
1463               AFS. If binaries are accidentally removed from a machine,
1464               you can recopy them onto the local disk from AFS rather than
1465               having to recover them from tape</para>
1466             </listitem>
1467           </varlistentry>
1468
1469           <varlistentry>
1470             <term><emphasis role="bold">usr</emphasis></term>
1471
1472             <listitem>
1473               <para>This directory contains home directories for your
1474               local users. As discussed in the previous entry for the
1475               <emphasis role="bold">public</emphasis> directory, it is
1476               often practical to protect this directory so that only
1477               locally authenticated users can access it. This keeps the
1478               contents of your user's home directories as secure as
1479               possible.</para>
1480
1481               <para>If your cell is quite large, directory lookup can be
1482               slowed if you put all home directories in a single <emphasis
1483               role="bold">usr</emphasis> directory. For suggestions on
1484               distributing user home directories among multiple grouping
1485               directories, see <link linkend="HDRWQ59">Grouping Home
1486               Directories</link>.</para>
1487             </listitem> </varlistentry>
1488
1489         </variablelist>
1490       </para>
1491
1492       <indexterm>
1493         <primary>volume name</primary>
1494
1495         <secondary>conventions for</secondary>
1496       </indexterm>
1497
1498       <indexterm>
1499         <primary>conventions</primary>
1500
1501         <secondary>volume names</secondary>
1502       </indexterm>
1503
1504       <indexterm>
1505         <primary>volume</primary>
1506
1507         <secondary>separate for each top level directory</secondary>
1508       </indexterm>
1509
1510       <indexterm>
1511         <primary>file tree</primary>
1512
1513         <secondary>creating volumes to match top level
1514         directories</secondary>
1515       </indexterm>
1516     </sect2>
1517   </sect1>
1518
1519   <sect1 id="HDRWQ44">
1520     <title>Creating Volumes to Simplify Administration</title>
1521
1522     <para>This section discusses how to create volumes in ways that make
1523     administering your system easier.</para>
1524
1525     <para>At the top levels of your file tree (at least through the third
1526     level), each directory generally corresponds to a separate
1527     volume. Some cells also configure the subdirectories of some third
1528     level directories as separate volumes. Common examples are the
1529     <emphasis
1530     role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1531     role="bold">/common</emphasis> and <emphasis
1532     role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1533     role="bold">/usr</emphasis> directories.</para>
1534
1535     <para>You do not have to create a separate volume for every directory
1536     level in a tree, but the advantage is that each volume tends to be
1537     smaller and easier to move for load balancing. The overhead for a
1538     mount point is no greater than for a standard directory, nor does the
1539     volume structure itself require much disk space. Most cells find that
1540     below the fourth level in the tree, using a separate volume for each
1541     directory is no longer efficient. For instance, while each user's home
1542     directory (at the fourth level in the tree) corresponds to a separate
1543     volume, all of the subdirectories in the home directory normally
1544     reside in the same volume.</para>
1545
1546     <para>Keep in mind that only one volume can be mounted at a given
1547     directory location in the tree. In contrast, a volume can be mounted
1548     at several locations, though this is not recommended because it
1549     distorts the hierarchical nature of the file tree, potentially causing
1550     confusion.</para>
1551
1552     <indexterm>
1553       <primary>volume name</primary>
1554
1555       <secondary>restrictions</secondary>
1556     </indexterm>
1557
1558     <indexterm>
1559       <primary>restrictions</primary>
1560
1561       <secondary>on volume names</secondary>
1562     </indexterm>
1563
1564     <indexterm>
1565       <primary>volume name</primary>
1566
1567       <secondary>two required</secondary>
1568     </indexterm>
1569
1570     <indexterm>
1571       <primary>volume</primary>
1572
1573       <secondary>root (root.afs and root.cell)</secondary>
1574     </indexterm>
1575
1576     <indexterm>
1577       <primary>root volumes (root.afs and root.cell)</primary>
1578     </indexterm>
1579
1580     <sect2 id="Header_55">
1581       <title>Assigning Volume Names</title>
1582
1583       <para>You can name your volumes anything you choose, subject to a
1584       few restrictions:
1585       <itemizedlist>
1586           <listitem>
1587             <para>Read/write volume names can be up to 22 characters in
1588             length. The maximum length for volume names is 31 characters,
1589             and there must be room to add the <emphasis
1590             role="bold">.readonly</emphasis> extension on read-only
1591             volumes.</para>
1592           </listitem>
1593
1594           <listitem>
1595             <para>Do not add the <emphasis
1596             role="bold">.readonly</emphasis> and <emphasis
1597             role="bold">.backup</emphasis> extensions to volume names
1598             yourself, even if they are appropriate. The Volume Server adds
1599             them automatically as it creates a read-only or backup version
1600             of a volume.</para>
1601           </listitem>
1602
1603           <listitem>
1604             <para>There must be volumes named <emphasis
1605             role="bold">root.afs</emphasis> and <emphasis
1606             role="bold">root.cell</emphasis>, mounted respectively at the
1607             top (<emphasis role="bold">/afs</emphasis>) level in the
1608             filespace and just below that level, at the cell's name (for
1609             example, at <emphasis role="bold">/afs/example.com</emphasis> in
1610             the Example Corporation cell).</para>
1611
1612             <para>Deviating from these names only creates confusion and
1613             extra work. Changing the name of the <emphasis
1614             role="bold">root.afs</emphasis> volume, for instance, means
1615             that you must use the <emphasis
1616             role="bold">-rootvol</emphasis> argument to the <emphasis
1617             role="bold">afsd</emphasis> program on every client machine,
1618             to name the alternate volume.</para>
1619
1620             <para>Similarly, changing the <emphasis
1621             role="bold">root.cell</emphasis> volume name prevents users in
1622             foreign cells from accessing your filespace, if the mount
1623             point for your cell in their filespace refers to the
1624             conventional <emphasis role="bold">root.cell</emphasis>
1625             name. Of course, this is one way to make your cell invisible
1626             to other cells.</para>
1627           </listitem>
1628       </itemizedlist>
1629       </para>
1630
1631       <para>It is best to assign volume names that indicate the type of
1632       data they contain, and to use similar names for volumes with similar
1633       contents. It is also helpful if the volume name is similar to (or at
1634       least has elements in common with) the name of the directory at
1635       which it is mounted. Understanding the pattern then enables you
1636       accurately to guess what a volume contains and where it is
1637       mounted.</para>
1638
1639       <para>Many cells find that the most effective volume naming scheme
1640       puts a common prefix on the names of all related volumes.  <link
1641       linkend="TBLVOL-PREFIX">Table 1</link> describes the recommended
1642       prefixing scheme.</para>
1643
1644       <table id="TBLVOL-PREFIX" label="1">
1645         <title>Suggested volume prefixes</title>
1646
1647         <tgroup cols="4">
1648           <colspec colwidth="14*" />
1649
1650           <colspec colwidth="28*" />
1651
1652           <colspec colwidth="22*" />
1653
1654           <colspec colwidth="36*" />
1655
1656           <thead>
1657             <row>
1658               <entry><emphasis role="bold">Prefix</emphasis></entry>
1659
1660               <entry><emphasis role="bold">Contents</emphasis></entry>
1661
1662               <entry><emphasis role="bold">Example Name</emphasis></entry>
1663
1664               <entry><emphasis role="bold">Example Mount
1665               Point</emphasis></entry>
1666             </row>
1667           </thead>
1668
1669           <tbody>
1670             <row>
1671               <entry><emphasis role="bold">common.</emphasis></entry>
1672
1673               <entry>popular programs and files</entry>
1674
1675               <entry><emphasis role="bold">common.etc</emphasis></entry>
1676
1677               <entry><emphasis
1678               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1679               role="bold">/common/etc</emphasis></entry>
1680             </row>
1681
1682             <row>
1683               <entry><emphasis role="bold">src.</emphasis></entry>
1684
1685               <entry>source code</entry>
1686
1687               <entry><emphasis role="bold">src.afs</emphasis></entry>
1688
1689               <entry><emphasis
1690               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1691               role="bold">/src/afs</emphasis></entry>
1692             </row>
1693
1694             <row>
1695               <entry><emphasis role="bold">proj.</emphasis></entry>
1696
1697               <entry>project data</entry>
1698
1699               <entry><emphasis role="bold">proj.portafs</emphasis></entry>
1700
1701               <entry><emphasis
1702               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1703               role="bold">/proj/portafs</emphasis></entry>
1704             </row>
1705
1706             <row>
1707               <entry><emphasis role="bold">test.</emphasis></entry>
1708
1709               <entry>testing or other temporary data</entry>
1710
1711               <entry><emphasis role="bold">test.smith</emphasis></entry>
1712
1713               <entry><emphasis
1714               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1715               role="bold">/usr/smith/test</emphasis></entry>
1716             </row>
1717
1718             <row>
1719               <entry><emphasis role="bold">user.</emphasis></entry>
1720
1721               <entry>user home directory data</entry>
1722
1723               <entry><emphasis role="bold">user.terry</emphasis></entry>
1724
1725               <entry><emphasis
1726               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1727               role="bold">/usr/terry</emphasis></entry>
1728             </row>
1729
1730             <row>
1731               <entry>sys_type<emphasis role="bold">.</emphasis></entry>
1732
1733               <entry>programs compiled for an operating system
1734               type</entry>
1735
1736               <entry><emphasis role="bold">rs_aix42.bin</emphasis></entry>
1737
1738               <entry><emphasis
1739               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1740               role="bold">/rs_aix42/bin</emphasis></entry>
1741             </row>
1742           </tbody>
1743         </tgroup>
1744       </table>
1745
1746       <para><link linkend="TBLPREFIX-EXAMPLE">Table 2</link> is a more
1747       specific example for a cell's <emphasis
1748       role="bold">rs_aix42</emphasis> system volumes and
1749       directories:</para>
1750
1751       <table id="TBLPREFIX-EXAMPLE" label="2">
1752         <title>Example volume-prefixing scheme</title>
1753
1754         <tgroup cols="2">
1755           <colspec colwidth="14*" />
1756
1757           <colspec colwidth="28*" />
1758
1759           <colspec colwidth="22*" />
1760
1761           <colspec colwidth="36*" />
1762
1763           <thead>
1764             <row>
1765               <entry><emphasis role="bold">Example Name</emphasis></entry>
1766
1767               <entry><emphasis role="bold">Example Mount
1768               Point</emphasis></entry>
1769             </row>
1770           </thead>
1771
1772           <tbody>
1773             <row>
1774               <entry><emphasis role="bold">rs_aix42.bin</emphasis></entry>
1775
1776               <entry><emphasis
1777               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1778               role="bold">/rs_aix42/bin</emphasis>, <emphasis
1779               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1780               role="bold">/rs_aix42/bin</emphasis></entry>
1781             </row>
1782
1783             <row>
1784               <entry><emphasis role="bold">rs_aix42.etc</emphasis></entry>
1785
1786               <entry><emphasis
1787               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1788               role="bold">/rs_aix42/etc</emphasis></entry>
1789             </row>
1790
1791             <row>
1792               <entry><emphasis role="bold">rs_aix42.usr</emphasis></entry>
1793
1794               <entry><emphasis
1795               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1796               role="bold">/rs_aix42/usr</emphasis></entry>
1797             </row>
1798
1799             <row>
1800               <entry><emphasis
1801               role="bold">rs_aix42.usr.afsws</emphasis></entry>
1802
1803               <entry><emphasis
1804               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1805               role="bold">/rs_aix42/usr/afsws</emphasis></entry>
1806             </row>
1807
1808             <row>
1809               <entry><emphasis
1810               role="bold">rs_aix42.usr.lib</emphasis></entry>
1811
1812               <entry><emphasis
1813               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1814               role="bold">/rs_aix42/usr/lib</emphasis></entry>
1815             </row>
1816
1817             <row>
1818               <entry><emphasis
1819               role="bold">rs_aix42.usr.bin</emphasis></entry>
1820
1821               <entry><emphasis
1822               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1823               role="bold">/rs_aix42/usr/bin</emphasis></entry>
1824             </row>
1825
1826             <row>
1827               <entry><emphasis
1828               role="bold">rs_aix42.usr.etc</emphasis></entry>
1829
1830               <entry><emphasis
1831               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1832               role="bold">/rs_aix42/usr/etc</emphasis></entry>
1833             </row>
1834
1835             <row>
1836               <entry><emphasis
1837               role="bold">rs_aix42.usr.inc</emphasis></entry>
1838
1839               <entry><emphasis
1840               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1841               role="bold">/rs_aix42/usr/inc</emphasis></entry>
1842             </row>
1843
1844             <row>
1845               <entry><emphasis
1846               role="bold">rs_aix42.usr.man</emphasis></entry>
1847
1848               <entry><emphasis
1849               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1850               role="bold">/rs_aix42/usr/man</emphasis></entry>
1851             </row>
1852
1853             <row>
1854               <entry><emphasis
1855               role="bold">rs_aix42.usr.sys</emphasis></entry>
1856
1857               <entry><emphasis
1858               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1859               role="bold">/rs_aix42/usr/sys</emphasis></entry>
1860             </row>
1861
1862             <row>
1863               <entry><emphasis
1864               role="bold">rs_aix42.usr.local</emphasis></entry>
1865
1866               <entry><emphasis
1867               role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
1868               role="bold">/rs_aix42/usr/local</emphasis></entry>
1869             </row>
1870           </tbody>
1871         </tgroup>
1872       </table>
1873
1874       <para>There are several advantages to this scheme:
1875       <itemizedlist>
1876           <listitem>
1877             <para>The volume name is similar to the mount point name in
1878             the filespace. In all of the entries in <link
1879             linkend="TBLPREFIX-EXAMPLE">Table 2</link>, for example, the
1880             only difference between the volume and mount point name is
1881             that the former uses periods as separators and the latter uses
1882             slashes. Another advantage is that the volume name indicates
1883             the contents, or at least suggests the directory on which to
1884             issue the <emphasis role="bold">ls</emphasis> command to learn
1885             the contents.</para>
1886           </listitem>
1887
1888           <listitem>
1889             <para>It makes it easy to manipulate groups of related volumes
1890             at one time. In particular, the <emphasis role="bold">vos
1891             backupsys</emphasis> command's <emphasis
1892             role="bold">-prefix</emphasis> argument enables you to create
1893             a backup version of every volume whose name starts with the
1894             same string of characters. Making a backup version of each
1895             volume is one of the first steps in backing up a volume with
1896             the AFS Backup System, and doing it for many volumes with one
1897             command saves you a good deal of typing. For instructions for
1898             creating backup volumes, see <link linkend="HDRWQ201">Creating
1899             Backup Volumes</link>, For information on the AFS Backup
1900             System, see <link linkend="HDRWQ248">Configuring the AFS
1901             Backup System</link> and <link linkend="HDRWQ283">Backing Up
1902             and Restoring AFS Data</link>.</para>
1903           </listitem>
1904
1905           <listitem>
1906             <para>It makes it easy to group related volumes together on a
1907             partition. Grouping related volumes together has several
1908             advantages of its own, discussed in <link
1909             linkend="HDRWQ49">Grouping Related Volumes on a
1910             Partition</link>.</para>
1911           </listitem>
1912       </itemizedlist>
1913       </para>
1914
1915       <indexterm>
1916         <primary>volume</primary>
1917
1918         <secondary>grouping related on same partition</secondary>
1919       </indexterm>
1920
1921       <indexterm>
1922         <primary>disk partition</primary>
1923
1924         <secondary>grouping related volumes on</secondary>
1925       </indexterm>
1926     </sect2>
1927
1928     <sect2 id="HDRWQ49">
1929       <title>Grouping Related Volumes on a Partition</title>
1930
1931       <para>If your cell is large enough to make it practical, consider
1932       grouping related volumes together on a partition. In general, you
1933       need at least three file server machines for volume grouping to be
1934       effective. Grouping has several advantages, which are most obvious
1935       when the file server machine becomes inaccessible:
1936       <itemizedlist>
1937           <listitem>
1938             <para>If you keep a hardcopy record of the volumes on a
1939             partition, you know which volumes are unavailable. You can
1940             keep such a record without grouping related volumes, but a
1941             list composed of unrelated volumes is much harder to maintain.
1942             Note that the record must be on paper, because the outage can
1943             prevent you from accessing an online copy or from issuing the
1944             <emphasis role="bold">vos listvol</emphasis> command, which
1945             gives you the same information.</para>
1946           </listitem>
1947
1948           <listitem>
1949             <para>The effect of an outage is more localized. For example,
1950             if all of the binaries for a given system type are on one
1951             partition, then only users of that system type are
1952             affected. If a partition houses binary volumes from several
1953             system types, then an outage can affect more people,
1954             particularly if the binaries that remain available are
1955             interdependent with those that are not available.</para>
1956           </listitem>
1957       </itemizedlist>
1958       </para>
1959
1960       <para>The advantages of grouping related volumes on a partition do
1961       not necessarily extend to the grouping of all related volumes on one
1962       file server machine. For instance, it is probably unwise in a cell
1963       with two file server machines to put all system volumes on one
1964       machine and all user volumes on the other. An outage of either
1965       machine probably affects everyone.</para>
1966
1967       <para>Admittedly, the need to move volumes for load balancing
1968       purposes can limit the practicality of grouping related volumes.
1969       You need to weigh the complementary advantages case by case.</para>
1970
1971       <indexterm>
1972         <primary>replication</primary>
1973
1974         <secondary>appropriate volumes</secondary>
1975       </indexterm>
1976
1977       <indexterm>
1978         <primary>volume</primary>
1979
1980         <secondary>type to replicate</secondary>
1981       </indexterm>
1982
1983       <indexterm>
1984         <primary>volume</primary>
1985
1986         <secondary>where to place replicated</secondary>
1987       </indexterm>
1988
1989       <indexterm>
1990         <primary>read-only volume</primary>
1991
1992         <secondary>selecting site</secondary>
1993       </indexterm>
1994     </sect2>
1995
1996     <sect2 id="HDRWQ50">
1997       <title>When to Replicate Volumes</title>
1998
1999       <para>As discussed in <link linkend="HDRWQ15">Replication</link>,
2000       replication refers to making a copy, or clone, of a read/write
2001       source volume and then placing the copy on one or more additional
2002       file server machines. Replicating a volume can increase the
2003       availability of the contents. If one file server machine housing the
2004       volume becomes inaccessible, users can still access the copy of the
2005       volume stored on a different machine. No one machine is likely to
2006       become overburdened with requests for a popular file, either,
2007       because the file is available from several machines.</para>
2008
2009       <para>However, replication is not appropriate for all cells. If a
2010       cell does not have much disk space, replication can be unduly
2011       expensive, because each clone not on the same partition as the
2012       read/write source takes up as much disk space as its source volume
2013       did at the time the clone was made. Also, if you have only one file
2014       server machine, replication uses up disk space without increasing
2015       availability.</para>
2016
2017       <para>Replication is also not appropriate for volumes that change
2018       frequently. You must issue the <emphasis role="bold">vos
2019       release</emphasis> command every time you need to update a read-only
2020       volume to reflect changes in its read/write source.</para>
2021
2022       <para>For both of these reasons, replication is appropriate only for
2023       popular volumes whose contents do not change very often, such as
2024       system binaries and other volumes mounted at the upper levels of
2025       your filespace. User volumes usually exist only in a read/write
2026       version since they change so often.</para>
2027
2028       <para>If you are replicating any volumes, you must replicate the
2029       <emphasis role="bold">root.afs</emphasis> and <emphasis
2030       role="bold">root.cell</emphasis> volumes, preferably at two or three
2031       sites each (even if your cell only has two or three file server
2032       machines). The Cache Manager needs to pass through the directories
2033       corresponding to the <emphasis role="bold">root.afs</emphasis> and
2034       <emphasis role="bold">root.cell</emphasis> volumes as it interprets
2035       any pathname. The unavailability of these volumes makes all other
2036       volumes unavailable too, even if the file server machines storing
2037       the other volumes are still functioning.</para>
2038
2039       <para>Another reason to replicate the <emphasis
2040       role="bold">root.afs</emphasis> volume is that it can lessen the
2041       load on the File Server machine. The Cache Manager has a bias to
2042       access a read-only version of the <emphasis
2043       role="bold">root.afs</emphasis> volume if it is replicate, which
2044       puts the Cache Manager onto the <emphasis>read-only path</emphasis>
2045       through the AFS filespace. While on the read-only path, the Cache
2046       Manager attempts to access a read-only copy of replicated
2047       volumes. The File Server needs to track only one callback per Cache
2048       Manager for all of the data in a read-only volume, rather than the
2049       one callback per file it must track for read/write volumes. Fewer
2050       callbacks translate into a smaller load on the File Server.</para>
2051
2052       <para>If the <emphasis role="bold">root.afs</emphasis> volume is not
2053       replicated, the Cache Manager follows a read/write path through the
2054       filespace, accessing the read/write version of each volume. The File
2055       Server distributes and tracks a separate callback for each file in a
2056       read/write volume, imposing a greater load on it.</para>
2057
2058       <para>For more on read/write and read-only paths, see <link
2059       linkend="HDRWQ209">The Rules of Mount Point Traversal</link>.</para>
2060
2061       <para>It also makes sense to replicate system binary volumes in many
2062       cases, as well as the volume corresponding to the <emphasis
2063       role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
2064       role="bold">/usr</emphasis> directory and the volumes corresponding
2065       to the <emphasis
2066       role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
2067       role="bold">/common</emphasis> directory and its
2068       subdirectories.</para>
2069
2070       <para>It is a good idea to place a replica on the same partition as
2071       the read/write source. In this case, the read-only volume is a clone
2072       (like a backup volume): it is a copy of the source volume's vnode
2073       index, rather than a full copy of the volume contents. Only if the
2074       read/write volume moves to another partition or changes
2075       substantially does the read-only volume consume significant disk
2076       space. Read-only volumes kept on other servers' partitions always
2077       consume the full amount of disk space that the read/write source
2078       consumed when the read-only volume was created.</para>
2079
2080       <para>You cannot have a replica volume on a different partition of
2081       the same server hosting the read/write volume. "Cheap" read-only
2082       volumes must be on the same partition as the read/write; all other
2083       read-only volumes must be on different servers.</para>
2084     </sect2>
2085
2086     <sect2 id="Header_58">
2087       <title>The Default Quota and ACL on a New Volume</title>
2088
2089       <para>Every AFS volume has associated with it a quota that limits
2090       the amount of disk space the volume is allowed to use. To set and
2091       change quota, use the commands described in <link
2092       linkend="HDRWQ234">Setting and Displaying Volume Quota and Current
2093       Size</link>.</para>
2094
2095       <para>By default, every new volume is assigned a space quota of 5000
2096       KB blocks unless you include the <emphasis
2097       role="bold">-maxquota</emphasis> argument to the <emphasis
2098       role="bold">vos create</emphasis> command. Also by default, the ACL
2099       on the root directory of every new volume grants all permissions to
2100       the members of the <emphasis
2101       role="bold">system:administrators</emphasis> group. To learn how to
2102       change these values when creating an account with individual
2103       commands, see <link linkend="HDRWQ503">To create one user account
2104       with individual commands</link>. When using <emphasis
2105       role="bold">uss</emphasis> commands to create accounts, you can
2106       specify alternate ACL and quota values in the template file's
2107       <emphasis role="bold">V</emphasis> instruction; see <link
2108       linkend="HDRWQ473">Creating a Volume with the V
2109       Instruction</link>.</para>
2110
2111       <indexterm>
2112         <primary>server machine</primary>
2113
2114         <secondary>configuration issues</secondary>
2115       </indexterm>
2116
2117       <indexterm>
2118         <primary>configuring</primary>
2119
2120         <secondary>file server machine, issues</secondary>
2121       </indexterm>
2122
2123       <indexterm>
2124         <primary>roles for server machine</primary>
2125
2126         <secondary>summary</secondary>
2127       </indexterm>
2128
2129       <indexterm>
2130         <primary>server machine</primary>
2131
2132         <secondary>roles for</secondary>
2133
2134         <tertiary>summary</tertiary>
2135       </indexterm>
2136
2137       <indexterm>
2138         <primary>server machine</primary>
2139
2140         <secondary>first installed</secondary>
2141       </indexterm>
2142     </sect2>
2143   </sect1>
2144
2145   <sect1 id="HDRWQ51">
2146     <title>Configuring Server Machines</title>
2147
2148     <para>This section discusses some issues to consider when configuring
2149     server machines, which store AFS data, transfer it to client machines
2150     on request, and house the AFS administrative databases. To learn about
2151     client machines, see <link linkend="HDRWQ54">Configuring Client
2152     Machines</link>.</para>
2153
2154     <para>If your cell has more than one AFS server machine, you can
2155     configure them to perform specialized functions. A machine can assume
2156     one or more of the roles described in the following list. For more
2157     details, see <link linkend="HDRWQ90">The Four Roles for File Server
2158     Machines</link>.
2159     <itemizedlist>
2160         <listitem>
2161           <para>A <emphasis>simple file server</emphasis> machine runs
2162           only the processes that store and deliver AFS files to client
2163           machines. You can run as many simple file server machines as you
2164           need to satisfy your cell's performance and disk space
2165           requirements.</para>
2166         </listitem>
2167
2168         <listitem>
2169           <para>A <emphasis>database server machine</emphasis> runs the
2170           four database server processes that maintain AFS's replicated
2171           administrative databases: the Authentication, Backup,
2172           Protection, and Volume Location (VL) Server processes.</para>
2173         </listitem>
2174
2175         <listitem>
2176           <para>A <emphasis>binary distribution machine</emphasis>
2177           distributes the AFS server binaries for its system type to all
2178           other server machines of that system type.</para>
2179         </listitem>
2180
2181         <listitem>
2182           <para>The single <emphasis>system control machine</emphasis>
2183           distributes common server configuration files to all other
2184           server machines in the cell.
2185           </para>
2186         </listitem>
2187     </itemizedlist>
2188     </para>
2189
2190     <para>The <emphasis>OpenAFS Quick Beginnings</emphasis> explains how
2191     to configure your cell's first file server machine to assume all four
2192     roles. The <emphasis>OpenAFS Quick Beginnings</emphasis> chapter on
2193     installing additional server machines also explains how to configure
2194     them to perform one or more roles.</para>
2195
2196     <indexterm>
2197       <primary>database server machine</primary>
2198
2199       <secondary>reason to run three</secondary>
2200     </indexterm>
2201
2202     <indexterm>
2203       <primary>distribution</primary>
2204
2205       <secondary>of databases</secondary>
2206     </indexterm>
2207
2208     <indexterm>
2209       <primary>databases, distributed</primary>
2210     </indexterm>
2211
2212     <indexterm>
2213       <primary>distributed databases</primary>
2214     </indexterm>
2215
2216     <sect2 id="HDRWQ52">
2217       <title>Replicating the OpenAFS Administrative Databases</title>
2218
2219       <para>The AFS administrative databases are housed on database server
2220       machines and store information that is crucial for correct cell
2221       functioning. Both server processes and Cache Managers access the
2222       information frequently:
2223       <itemizedlist>
2224           <listitem>
2225             <para>Every time a Cache Manager fetches a file from a
2226             directory that it has not previously accessed, it must look up
2227             the file's location in the Volume Location Database
2228             (VLDB).</para>
2229           </listitem>
2230
2231           <listitem>
2232             <para>Every time a user obtains an AFS token from the
2233             Authentication Server, the server looks up the user's password
2234             in the Authentication Database.</para>
2235           </listitem>
2236
2237           <listitem>
2238             <para>The first time that a user accesses a volume housed on a
2239             specific file server machine, the File Server contacts the
2240             Protection Server for a list of the user's group memberships
2241             as recorded in the Protection Database.</para>
2242           </listitem>
2243
2244           <listitem>
2245             <para>Every time you back up a volume using the AFS Backup
2246             System, the Backup Server creates records for it in the Backup
2247             Database.</para>
2248           </listitem>
2249       </itemizedlist>
2250       </para>
2251
2252       <para>Maintaining your cell is simplest if the first machine has the
2253       lowest IP address of any machine you plan to use as a database
2254       server machine. If you later decide to use a machine with a lower IP
2255       address as a database server machine, you must update the <emphasis
2256       role="bold">CellServDB</emphasis> file on all clients before
2257       introducing the new machine.</para>
2258
2259       <para>If your cell has more than one server machine, it is best to
2260       run more than one as a database server machine (but more than three
2261       are rarely necessary). Replicating the administrative databases in
2262       this way yields the same benefits as replicating volumes: increased
2263       availability and reliability. If one database server machine or
2264       process stops functioning, the information in the database is still
2265       available from others. The load of requests for database information
2266       is spread across multiple machines, preventing any one from becoming
2267       overloaded.</para>
2268
2269       <para>Unlike replicated volumes, however, replicated databases do
2270       change frequently. Consistent system performance demands that all
2271       copies of the database always be identical, so it is not acceptable
2272       to record changes in only some of them. To synchronize the copies of
2273       a database, the database server processes use AFS's distributed
2274       database technology, Ubik. See <link linkend="HDRWQ102">Replicating
2275       the OpenAFS Administrative Databases</link>.</para>
2276
2277       <para>If your cell has only one file server machine, it must also
2278       serve as a database server machine. If you cell has two file server
2279       machines, it is not always advantageous to run both as database
2280       server machines. If a server, process, or network failure interrupts
2281       communications between the database server processes on the two
2282       machines, it can become impossible to update the information in the
2283       database because neither of them can alone elect itself as the
2284       synchronization site.</para>
2285
2286       <indexterm>
2287         <primary>server machine</primary>
2288
2289         <secondary>protecting directories on local disk</secondary>
2290       </indexterm>
2291
2292       <indexterm>
2293         <primary>local disk</primary>
2294
2295         <secondary>protecting on file server machine</secondary>
2296       </indexterm>
2297     </sect2>
2298
2299     <sect2 id="HDRWQ53">
2300       <title>AFS Files on the Local Disk</title>
2301
2302       <para>It is generally simplest to store the binaries for all AFS
2303       server processes in the <emphasis
2304       role="bold">/usr/afs/bin</emphasis> directory on every file server
2305       machine, even if some processes do not actively run on the
2306       machine. This makes it easier to reconfigure a machine to fill a new
2307       role.</para>
2308
2309       <para>For security reasons, the <emphasis
2310       role="bold">/usr/afs</emphasis> directory on a file server machine
2311       and all of its subdirectories and files must be owned by the local
2312       superuser <emphasis role="bold">root</emphasis> and have only the
2313       first <emphasis role="bold">w</emphasis> (<emphasis
2314       role="bold">write</emphasis>) mode bit turned on. Some files even
2315       have only the first <emphasis role="bold">r</emphasis> (<emphasis
2316       role="bold">read</emphasis>) mode bit turned on (for example, the
2317       <emphasis role="bold">/usr/afs/etc/KeyFile</emphasis> file, which
2318       lists the AFS server encryption keys). Each time the BOS Server
2319       starts, it checks that the mode bits on certain files and
2320       directories match the expected values. For a list, see the
2321       <emphasis>OpenAFS Quick Beginnings</emphasis> section about
2322       protecting sensitive AFS directories, or the discussion of the
2323       output from the <emphasis role="bold">bos status</emphasis> command
2324       in <link linkend="HDRWQ159">To display the status of server
2325       processes and their BosConfig entries</link>.</para>
2326
2327       <para>For a description of the contents of all AFS directories on a
2328       file server machine's local disk, see <link
2329       linkend="HDRWQ80">Administering Server Machines</link>.</para>
2330     </sect2>
2331
2332     <sect2 id="Header_62">
2333       <title>Configuring Partitions to Store AFS Data</title>
2334
2335       <para>The partitions that house AFS volumes on a file server machine
2336       must be mounted at directories named</para>
2337
2338       <para><emphasis
2339       role="bold">/vicep</emphasis><emphasis>index</emphasis></para>
2340
2341       <para>where <emphasis>index</emphasis> is one or two lowercase
2342       letters. By convention, the first AFS partition created is mounted
2343       at the <emphasis role="bold">/vicepa</emphasis> directory, the
2344       second at the <emphasis role="bold">/vicepb</emphasis> directory,
2345       and so on through the <emphasis role="bold">/vicepz</emphasis>
2346       directory. The names then continue with <emphasis
2347       role="bold">/vicepaa</emphasis> through <emphasis
2348       role="bold">/vicepaz</emphasis>, <emphasis
2349       role="bold">/vicepba</emphasis> through <emphasis
2350       role="bold">/vicepbz</emphasis>, and so on, up to the maximum
2351       supported number of server partitions, which is specified in the
2352       OpenAFS Release Notes.</para>
2353
2354       <para>Each <emphasis role="bold">/vicep</emphasis>x directory must
2355       correspond to an entire partition or logical volume, and must be a
2356       subdirectory of the root directory (/). It is not acceptable to
2357       configure part of (for example) the <emphasis
2358       role="bold">/usr</emphasis> partition as an AFS server partition and
2359       mount it on a directory called <emphasis
2360       role="bold">/usr/vicepa</emphasis>.</para>
2361
2362       <para>Also, do not store non-AFS files on AFS server partitions. The
2363       File Server and Volume Server expect to have available all of the
2364       space on the partition. Sharing space also creates competition
2365       between AFS and the local UNIX file system for access to the
2366       partition, particularly if the UNIX files are frequently
2367       used.</para>
2368
2369       <indexterm>
2370         <primary>server machine</primary>
2371
2372         <secondary>monitoring</secondary>
2373       </indexterm>
2374
2375       <indexterm>
2376         <primary>file server machine</primary>
2377
2378         <secondary>rebooting, about</secondary>
2379       </indexterm>
2380
2381       <indexterm>
2382         <primary>rebooting</primary>
2383
2384         <secondary>file server machine, limiting</secondary>
2385       </indexterm>
2386
2387       <indexterm>
2388         <primary>weekly restart of BOS Server (automatic)</primary>
2389
2390         <secondary>about</secondary>
2391       </indexterm>
2392
2393       <indexterm>
2394         <primary>restart times for BOS Server</primary>
2395
2396         <secondary>about</secondary>
2397       </indexterm>
2398     </sect2>
2399
2400     <sect2 id="Header_63">
2401       <title>Monitoring, Rebooting and Automatic Process Restarts</title>
2402
2403       <para>AFS provides several tools for monitoring the File Server,
2404       including the <emphasis role="bold">scout</emphasis> and <emphasis
2405       role="bold">afsmonitor</emphasis> programs. You can configure them
2406       to alert you when certain threshold values are exceeded, for example
2407       when a server partition is more than 95% full. See <link
2408       linkend="HDRWQ323">Monitoring and Auditing AFS
2409       Performance</link>.</para>
2410
2411       <para>Rebooting a file server machine requires shutting down the AFS
2412       processes and so inevitably causes a service outage.  Reboot file
2413       server machines as infrequently as possible. For instructions, see
2414       <link linkend="HDRWQ139">Rebooting a Server Machine</link>.</para>
2415
2416       <para>The BOS Server checks each morning at 5:00 a.m. for any newly
2417       installed binary files in the <emphasis
2418       role="bold">/usr/afs/bin</emphasis> directory. It compares the
2419       timestamp on each binary file to the time at which the corresponding
2420       process last restarted. If the timestamp on the binary is later, the
2421       BOS Server restarts the corresponding process to start using
2422       it.</para>
2423
2424       <para>The BOS server also supports performing a weekly restart of
2425       all AFS server processes, including itself. This functionality is
2426       disabled on new installs, but historically it was set to 4:00am on
2427       Sunday. Administrators may find that installations predating OpenAFS
2428       1.6.0 have weekly restarts enabled.</para>
2429
2430       <para>The default times are in the early morning hours when the
2431       outage that results from restarting a process is likely to disturb
2432       the fewest number of people. You can display the restart times for
2433       each machine with the <emphasis role="bold">bos
2434       getrestart</emphasis> command, and set them with the <emphasis
2435       role="bold">bos setrestart</emphasis> command. The latter command
2436       enables you to disable automatic restarts entirely, by setting the
2437       time to <emphasis role="bold">never</emphasis>. See <link
2438       linkend="HDRWQ171">Setting the BOS Server's Restart
2439       Times</link>.</para>
2440
2441       <indexterm>
2442         <primary>client machine</primary>
2443
2444         <secondary>configuration issues</secondary>
2445       </indexterm>
2446
2447       <indexterm>
2448         <primary>configuring</primary>
2449
2450         <secondary>client machine, issues</secondary>
2451       </indexterm>
2452     </sect2>
2453   </sect1>
2454
2455   <sect1 id="HDRWQ54">
2456     <title>Configuring Client Machines</title>
2457
2458     <para>This section summarizes issues to consider as you install and
2459     configure client machines in your cell.</para>
2460
2461     <indexterm>
2462       <primary>client machine</primary>
2463
2464       <secondary>files required on local disk</secondary>
2465     </indexterm>
2466
2467     <indexterm>
2468       <primary>local disk</primary>
2469
2470       <secondary>files required on client machine</secondary>
2471     </indexterm>
2472
2473     <indexterm>
2474       <primary>file</primary>
2475
2476       <secondary>required on client machine local disk</secondary>
2477     </indexterm>
2478
2479     <sect2 id="HDRWQ55">
2480       <title>Configuring the Local Disk</title>
2481
2482       <para>You can often free up significant amounts of local disk space
2483       on AFS client machines by storing standard UNIX files in AFS and
2484       creating symbolic links to them from the local disk. The <emphasis
2485       role="bold">@sys</emphasis> pathname variable can be useful in links
2486       to system-specific files; see <link linkend="HDRWQ56">Using the @sys
2487       Variable in Pathnames</link>.</para>
2488
2489       <para>There are two types of files that must actually reside on the
2490       local disk: boot sequence files needed before the <emphasis
2491       role="bold">afsd</emphasis> program is invoked, and files that can
2492       be helpful during file server machine outages.</para>
2493
2494       <para>During a reboot, AFS is inaccessible until the <emphasis
2495       role="bold">afsd</emphasis> program executes and initializes the
2496       Cache Manager. (In the conventional configuration, the AFS
2497       initialization file is included in the machine's initialization
2498       sequence and invokes the <emphasis role="bold">afsd</emphasis>
2499       program.) Files needed during reboot prior to that point must reside
2500       on the local disk. They include the following, but this list is not
2501       necessarily exhaustive.
2502       <itemizedlist>
2503           <listitem>
2504             <para>Standard UNIX utilities including the following or their
2505             equivalents:
2506             <itemizedlist>
2507                 <listitem>
2508                   <para>Machine initialization files (stored in the
2509                   <emphasis role="bold">/etc</emphasis> or <emphasis
2510                   role="bold">/sbin</emphasis> directory on many system
2511                   types)</para>
2512                 </listitem>
2513
2514                 <listitem>
2515                   <para>The <emphasis role="bold">fstab</emphasis>
2516                   file</para>
2517                 </listitem>
2518
2519                 <listitem>
2520                   <para>The <emphasis role="bold">mount</emphasis> command
2521                   binary</para>
2522                 </listitem>
2523
2524                 <listitem>
2525                   <para>The <emphasis role="bold">umount</emphasis>
2526                   command binary</para>
2527                 </listitem>
2528               </itemizedlist>
2529           </para>
2530           </listitem>
2531
2532           <listitem>
2533             <para>All subdirectories and files in the <emphasis
2534             role="bold">/usr/vice</emphasis> directory, including the
2535             following:
2536             <itemizedlist>
2537                 <listitem>
2538                   <para>The <emphasis
2539                   role="bold">/usr/vice/cache</emphasis> directory</para>
2540                 </listitem>
2541
2542                 <listitem>
2543                   <para>The <emphasis
2544                   role="bold">/usr/vice/etc/afsd</emphasis> command
2545                   binary</para>
2546                 </listitem>
2547
2548                 <listitem>
2549                   <para>The <emphasis
2550                   role="bold">/usr/vice/etc/cacheinfo</emphasis> file</para>
2551                 </listitem>
2552
2553                 <listitem>
2554                   <para>The <emphasis
2555                   role="bold">/usr/vice/etc/CellServDB</emphasis>
2556                   file</para>
2557                 </listitem>
2558
2559                 <listitem>
2560                   <para>The <emphasis
2561                   role="bold">/usr/vice/etc/ThisCell</emphasis> file</para>
2562                 </listitem>
2563               </itemizedlist>
2564             </para>
2565
2566             <para>For more information on these files, see <link
2567             linkend="HDRWQ391">Configuration and Cache-Related Files on
2568             the Local Disk</link>.</para>
2569           </listitem>
2570       </itemizedlist>
2571       </para>
2572
2573       <para>The other type of files and programs to retain on the local
2574       disk are those you need when diagnosing and fixing problems caused
2575       by a file server outage, because the outage can make inaccessible
2576       the copies stored in AFS. Examples include the binaries for a text
2577       editor (such as <emphasis role="bold">ed</emphasis> or <emphasis
2578       role="bold">vi</emphasis>) and for the <emphasis
2579       role="bold">fs</emphasis> and <emphasis role="bold">bos</emphasis>
2580       commands. Store copies of AFS command binaries in the <emphasis
2581       role="bold">/usr/vice/etc</emphasis> directory as well as including
2582       them in the <emphasis role="bold">/usr/afsws</emphasis> directory,
2583       which is normally a link into AFS. Then place the <emphasis
2584       role="bold">/usr/afsws</emphasis> directory before the <emphasis
2585       role="bold">/usr/vice/etc</emphasis> directory in users'
2586       <envar>PATH</envar> environment variable definition. When AFS is
2587       functioning normally, users access the copy in the <emphasis
2588       role="bold">/usr/afsws</emphasis> directory, which is more likely to
2589       be current than a local copy.</para>
2590     </sect2>
2591
2592     <sect2 id="Header_66">
2593       <title>Enabling Access to Foreign Cells</title>
2594
2595       <indexterm>
2596         <primary>client machine</primary>
2597
2598         <secondary>enabling access to foreign cell</secondary>
2599       </indexterm>
2600
2601       <para>As detailed in <link linkend="HDRWQ39">Making Other Cells
2602       Visible in Your Cell</link>, you enable the Cache Manager to access
2603       a cell's AFS filespace by storing a list of the cell's database
2604       server machines in the local <emphasis
2605       role="bold">/usr/vice/etc/CellServDB</emphasis> file. The Cache
2606       Manager reads the list into kernel memory at reboot for faster
2607       retrieval. You can change the list in kernel memory between reboots
2608       by using the <emphasis role="bold">fs newcell</emphasis> command.</para>
2609
2610       <para>Because each client machine maintains its own copy of the
2611       <emphasis role="bold">CellServDB</emphasis> file, you can in theory
2612       enable access to different foreign cells on different client
2613       machines. This is not usually practical, however, especially if
2614       users do not always work on the same machine.</para>
2615
2616       <indexterm>
2617         <primary>at-sys (@sys) variable in pathnames</primary>
2618       </indexterm>
2619
2620       <indexterm>
2621         <primary>sys (@sys) variable in pathnames</primary>
2622       </indexterm>
2623
2624       <indexterm>
2625         <primary>variables</primary>
2626
2627         <secondary>@sys in pathnames</secondary>
2628       </indexterm>
2629     </sect2>
2630
2631     <sect2 id="HDRWQ56">
2632       <title>Using the @sys Variable in Pathnames</title>
2633
2634       <para>When creating symbolic links into AFS on the local disk, it is
2635       often practical to use the @sys variable in pathnames.  The Cache
2636       Manager automatically substitutes the local machine's AFS system
2637       name (CPU/operating system type) for the @sys variable. This means
2638       you can place the same links on machines of various system types and
2639       still have each machine access the binaries for its system type. For
2640       example, the Cache Manager on a machine running AIX 4.2 converts
2641       <emphasis role="bold">/afs/example.com/@sys</emphasis> to <emphasis
2642       role="bold">/afs/example.com/rs_aix42</emphasis>, whereas a machine
2643       running Solaris 10 converts it to <emphasis
2644       role="bold">/afs/example.com/sun4x_510</emphasis>.</para>
2645
2646       <para>If you want to use the @sys variable, it is simplest to use
2647       the conventional AFS system type names as specified in the OpenAFS
2648       Release Notes. The Cache Manager records the local machine's system
2649       type name in kernel memory during initialization.  If you do not use
2650       the conventional names, you must use the <emphasis role="bold">fs
2651       sysname</emphasis> command to change the value in kernel memory from
2652       its default just after Cache Manager initialization, on every client
2653       machine of the relevant system type. The <emphasis role="bold">fs
2654       sysname</emphasis> command also displays the current value; see
2655       <link linkend="HDRWQ417">Displaying and Setting the System Type
2656       Name</link>.</para>
2657
2658       <para>In pathnames in the AFS filespace itself, use the @sys
2659       variable carefully and sparingly, because it can lead to unexpected
2660       results. It is generally best to restrict its use to only one level
2661       in the filespace. The third level is a common choice, because that
2662       is where many cells store the binaries for different machine
2663       types.</para>
2664
2665       <para>Multiple instances of the @sys variable in a pathname are
2666       especially dangerous to people who must explicitly change
2667       directories (with the <emphasis role="bold">cd</emphasis> command,
2668       for example) into directories that store binaries for system types
2669       other than the machine on which they are working, such as
2670       administrators or developers who maintain those directories. After
2671       changing directories, it is recommended that such people verify they
2672       are in the desired directory.</para>
2673     </sect2>
2674
2675     <sect2 id="Header_68">
2676       <title>Setting Server Preferences</title>
2677
2678       <para>The Cache Manager stores a table of preferences for file
2679       server machines in kernel memory. A preference rank pairs a file
2680       server machine interface's IP address with an integer in the range
2681       from 1 to 65,534. When it needs to access a file, the Cache Manager
2682       compares the ranks for the interfaces of all machines that house the
2683       file, and first attempts to access the file via the interface with
2684       the best rank. As it initializes, the Cache Manager sets default
2685       ranks that bias it to access files via interfaces that are close to
2686       it in terms of network topology. You can adjust the preference ranks
2687       to improve performance if you wish.</para>
2688
2689       <para>The Cache Manager also uses similar preferences for Volume
2690       Location (VL) Server machines. Use the <emphasis role="bold">fs
2691       getserverprefs</emphasis> command to display preference ranks and
2692       the <emphasis role="bold">fs setserverprefs</emphasis> command to
2693       set them. See <link linkend="HDRWQ414">Maintaining Server Preference
2694       Ranks</link>.</para>
2695
2696       <indexterm>
2697         <primary>user account</primary>
2698
2699         <secondary>configuration issues</secondary>
2700       </indexterm>
2701     </sect2> </sect1>
2702
2703   <sect1 id="HDRWQ57">
2704     <title>Configuring AFS User Accounts</title>
2705
2706     <para>This section discusses some of the issues to consider when
2707     configuring AFS user accounts. Because AFS is separate from the UNIX
2708     file system, a user's AFS account is separate from her UNIX
2709     account.</para>
2710
2711     <para>The preferred method for creating a user account is with the
2712     <emphasis role="bold">uss</emphasis> suite of commands. With a single
2713     command, you can create all the components of one or many accounts,
2714     after you have prepared a template file that guides the account
2715     creation. See <link linkend="HDRWQ449">Creating and Deleting User
2716     Accounts with the uss Command Suite</link>.</para>
2717
2718     <para>Alternatively, you can issue the individual commands that create
2719     each component of an account. For instructions, along with
2720     instructions for removing user accounts and changing user passwords,
2721     user volume quotas and usernames, see <link
2722     linkend="HDRWQ491">Administering User Accounts</link>.</para>
2723
2724     <para>When users leave your system, it is often good policy to remove
2725     their accounts. Instructions appear in <link
2726     linkend="HDRWQ486">Deleting Individual Accounts with the uss delete
2727     Command</link> and <link linkend="HDRWQ524">Removing a User
2728     Account</link>.</para>
2729
2730     <para>An AFS user account consists of the following components, which
2731     are described in greater detail in <link linkend="HDRWQ494">The
2732     Components of an AFS User Account</link>.
2733     <itemizedlist>
2734         <listitem>
2735           <para>A Protection Database entry</para>
2736         </listitem>
2737
2738         <listitem>
2739           <para>An Authentication Database entry</para>
2740         </listitem>
2741
2742         <listitem>
2743           <para>A volume</para>
2744         </listitem>
2745
2746         <listitem>
2747           <para>A home directory at which the volume is mounted</para>
2748         </listitem>
2749
2750         <listitem>
2751           <para>Ownership of the home directory and full permissions on
2752           its ACL</para>
2753         </listitem>
2754
2755         <listitem>
2756           <para>An entry in the local password file (<emphasis
2757           role="bold">/etc/passwd</emphasis> or equivalent) of each
2758           machine the user needs to log into</para>
2759         </listitem>
2760
2761         <listitem>
2762           <para>Optionally, standard files and subdirectories that make
2763           the account more useful</para>
2764         </listitem>
2765       </itemizedlist>
2766     </para>
2767
2768     <para>By creating some components but not others, you can create
2769     accounts at different levels of functionality, using either <emphasis
2770     role="bold">uss</emphasis> commands as described in <link
2771     linkend="HDRWQ449">Creating and Deleting User Accounts with the uss
2772     Command Suite</link> or individual commands as described in <link
2773     linkend="HDRWQ491">Administering User Accounts</link>.  The levels of
2774     functionality include the following
2775     <itemizedlist>
2776         <listitem>
2777           <para>An authentication-only account enables the user to obtain
2778           AFS tokens and so to access protected AFS data and to issue
2779           privileged commands. It consists only of entries in the
2780           Authentication and Protection Database. This type of account is
2781           suitable for administrative accounts and for users from foreign
2782           cells who need to access protected data. Local users generally
2783           also need a volume and home directory.</para>
2784         </listitem>
2785
2786         <listitem>
2787           <para>A basic user account includes a volume for the user, in
2788           addition to Authentication and Protection Database entries.  The
2789           volume is mounted in the AFS filespace as the user's home
2790           directory, and provides a repository for the user's personal
2791           files.</para>
2792         </listitem>
2793
2794         <listitem>
2795           <para>A full account adds configuration files for basic
2796           functions such as logging in, printing, and mail delivery to a
2797           basic account, making it more convenient and useful. For a
2798           discussion of some useful types of configuration files, see
2799           <link linkend="HDRWQ60">Creating Standard Files in New AFS
2800           Accounts</link>.</para>
2801         </listitem>
2802     </itemizedlist>
2803     </para>
2804
2805     <para>If your users have UNIX user accounts that predate the
2806     introduction of AFS in the cell, you possibly want to convert them
2807     into AFS accounts. There are three main issues to consider:
2808     <itemizedlist>
2809         <listitem>
2810           <para>Making UNIX and AFS UIDs match</para> </listitem>
2811
2812         <listitem>
2813           <para>Setting the password field in the local password file
2814           appropriately</para>
2815         </listitem>
2816
2817         <listitem>
2818           <para>Moving files from the UNIX file system into AFS</para>
2819         </listitem>
2820     </itemizedlist>
2821     </para>
2822
2823     <para>For further discussion, see <link linkend="HDRWQ459">Converting
2824     Existing UNIX Accounts with uss</link> or <link
2825     linkend="HDRWQ498">Converting Existing UNIX Accounts</link>.</para>
2826
2827     <indexterm>
2828       <primary>username</primary>
2829
2830       <secondary>choosing</secondary>
2831     </indexterm>
2832
2833     <indexterm>
2834       <primary>user</primary>
2835
2836       <secondary>name</secondary>
2837
2838       <see>username</see>
2839     </indexterm>
2840
2841     <indexterm>
2842       <primary>choosing</primary>
2843
2844       <secondary>name</secondary>
2845
2846       <tertiary>user</tertiary>
2847     </indexterm>
2848
2849     <indexterm>
2850       <primary>anonymous user</primary>
2851
2852       <secondary>AFS UID reserved</secondary>
2853     </indexterm>
2854
2855     <indexterm>
2856       <primary>AFS UID</primary>
2857
2858       <secondary>reserved</secondary>
2859
2860       <tertiary>anonymous user</tertiary>
2861     </indexterm>
2862
2863     <sect2 id="HDRWQ58">
2864       <title>Choosing Usernames and Naming Other Account
2865       Components</title>
2866
2867       <para>This section suggests schemes for choosing usernames, AFS
2868       UIDs, user volume names and mount point names, and also outlines
2869       some restrictions on your choices.</para>
2870
2871       <formalpara>
2872         <title>Usernames</title>
2873
2874         <para>AFS imposes very few restrictions on the form of
2875         usernames. It is best to keep usernames short, both because many
2876         utilities and applications can handle usernames of no more than
2877         eight characters and because by convention many components of and
2878         AFS account incorporate the name. These include the entries in the
2879         Protection and Authentication Databases, the volume, and the mount
2880         point. Depending on your electronic mail delivery system, the
2881         username can become part of the user's mailing address. The
2882         username is also the string that the user types when logging in to
2883         a client machine.</para>
2884       </formalpara>
2885
2886       <para>Some common choices for usernames are last names, first names,
2887       initials, or a combination, with numbers sometimes added.  It is
2888       also best to avoid using the following characters, many of which
2889       have special meanings to the command shell.
2890       <itemizedlist>
2891           <listitem>
2892             <para>The comma (<emphasis role="bold">,</emphasis>)</para>
2893           </listitem>
2894
2895           <listitem>
2896             <para>The colon (<emphasis role="bold">:</emphasis>), because
2897             AFS reserves it as a field separator in protection group
2898             names; see <link linkend="HDRWQ62">The Two Types of
2899             User-Defined Groups</link></para>
2900           </listitem>
2901
2902           <listitem>
2903             <para>The semicolon (<emphasis
2904             role="bold">;</emphasis>)</para>
2905           </listitem>
2906
2907           <listitem>
2908             <para>The "at-sign" (<emphasis role="bold">@</emphasis>); this
2909             character is reserved for Internet mailing addresses</para>
2910           </listitem>
2911
2912           <listitem>
2913             <para>Spaces</para>
2914           </listitem>
2915
2916           <listitem>
2917             <para>The newline character</para>
2918           </listitem>
2919
2920           <listitem>
2921             <para>The period (<emphasis role="bold">.</emphasis>); it is
2922             conventional to use this character only in the special
2923             username that an administrator adopts while performing
2924             privileged tasks, such as <emphasis
2925             role="bold">pat.admin</emphasis></para>
2926           </listitem>
2927       </itemizedlist>
2928       </para>
2929
2930       <formalpara>
2931         <title>AFS UIDs and UNIX UIDs</title>
2932
2933         <para>AFS associates a unique identification number, the AFS UID,
2934         with every username, recording the mapping in the user's
2935         Protection Database entry. The AFS UID functions within AFS much
2936         as the UNIX UID does in the local file system: the AFS server
2937         processes and the Cache Manager use it internally to identify a
2938         user, rather than the username.</para>
2939       </formalpara>
2940
2941       <para>Every AFS user also must have a UNIX UID recorded in the local
2942       password file (<emphasis role="bold">/etc/passwd</emphasis> or
2943       equivalent) of each client machine they log onto. Both
2944       administration and a user's AFS access are simplest if the AFS UID
2945       and UNIX UID match. One important consequence of matching UIDs is
2946       that the owner reported by the <emphasis role="bold">ls
2947       -l</emphasis> command matches the AFS username.</para>
2948
2949       <para>It is usually best to allow the Protection Server to allocate
2950       the AFS UID as it creates the Protection Database entry.  However,
2951       both the <emphasis role="bold">pts createuser</emphasis> command and
2952       the <emphasis role="bold">uss</emphasis> commands that create user
2953       accounts enable you to assign AFS UIDs explicitly. This is
2954       appropriate in two cases:
2955       <itemizedlist>
2956           <listitem>
2957             <para>You wish to group together the AFS UIDs of related
2958             users</para>
2959           </listitem>
2960
2961           <listitem>
2962             <para>You are converting an existing UNIX account into an AFS
2963             account and want to make the AFS UID match the existing UNIX
2964             UID</para>
2965           </listitem>
2966       </itemizedlist>
2967       </para>
2968
2969       <para>After the Protection Server initializes for the first time on
2970       a cell's first file server machine, it starts assigning AFS UIDs at
2971       a default value. To change the default before creating any user
2972       accounts, or at any time, use the <emphasis role="bold">pts
2973       setmax</emphasis> command to reset the <computeroutput>max user id
2974       counter</computeroutput>. To display the counter, use the <emphasis
2975       role="bold">pts listmax</emphasis> command. See <link
2976       linkend="HDRWQ560">Displaying and Setting the AFS UID and GID
2977       Counters</link>.</para>
2978
2979       <para>AFS reserves one AFS UID, 32766, for the user <emphasis
2980       role="bold">anonymous</emphasis>. The AFS server processes assign
2981       this identity and AFS UID to any user who does not possess a token
2982       for the local cell. Do not assign this AFS UID to any other user or
2983       hardcode its current value into any programs or a file's owner
2984       field, because it is subject to change in future releases.</para>
2985
2986       <indexterm>
2987         <primary>username</primary>
2988
2989         <secondary>part of volume name</secondary>
2990       </indexterm>
2991
2992       <indexterm>
2993         <primary>choosing</primary>
2994
2995         <secondary>name</secondary>
2996
2997         <tertiary>user volume</tertiary>
2998       </indexterm>
2999
3000       <formalpara>
3001         <title>User Volume Names</title>
3002
3003         <para>Like any volume name, a user volume's base (read/write) name
3004         cannot exceed 22 characters in length or include the <emphasis
3005         role="bold">.readonly</emphasis> or <emphasis
3006         role="bold">.backup</emphasis> extension. See <link
3007         linkend="HDRWQ44">Creating Volumes to Simplify
3008         Administration</link>. By convention, user volume names have the
3009         format <emphasis role="bold">user.</emphasis>username. Using the
3010         <emphasis role="bold">user.</emphasis> prefix not only makes it
3011         easy to identify the volume's contents, but also to create a
3012         backup version of all user volumes by issuing a single <emphasis
3013         role="bold">vos backupsys</emphasis> command.</para>
3014       </formalpara>
3015
3016       <indexterm>
3017         <primary>mount point</primary>
3018
3019         <secondary>choosing name for user volume</secondary>
3020       </indexterm>
3021
3022       <indexterm>
3023         <primary>choosing</primary>
3024
3025         <secondary>name</secondary>
3026
3027         <tertiary>user volume mount point</tertiary>
3028       </indexterm>
3029
3030       <formalpara>
3031         <title>Mount Point Names</title>
3032
3033         <para>By convention, the mount point for a user's volume is named
3034         after the username. Many cells follow the convention of mounting
3035         user volumes in the <emphasis
3036         role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
3037         role="bold">/usr</emphasis> directory, as discussed in <link
3038         linkend="HDRWQ43">The Third Level</link>. Very large cells
3039         sometimes find that mounting all user volumes in the same
3040         directory slows directory lookup, however; for suggested
3041         alternatives, see the following section.</para>
3042       </formalpara>
3043
3044       <indexterm>
3045         <primary>directories</primary>
3046
3047         <secondary>for grouping user home directories</secondary>
3048       </indexterm>
3049
3050       <indexterm>
3051         <primary>user account</primary>
3052
3053         <secondary>suggestions for grouping home directories</secondary>
3054       </indexterm>
3055     </sect2>
3056
3057     <sect2 id="HDRWQ59">
3058       <title>Grouping Home Directories</title>
3059
3060       <para>Mounting user volumes in the <emphasis
3061       role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
3062       role="bold">/usr</emphasis> directory is an AFS-appropriate
3063       variation on the standard UNIX practice of putting user home
3064       directories under the <emphasis role="bold">/usr</emphasis>
3065       subdirectory. However, cells with more than a few hundred users
3066       sometimes find that mounting all user volumes in a single directory
3067       results in slow directory lookup. The solution is to distribute user
3068       volume mount points into several directories; there are a number of
3069       alternative methods to accomplish this.
3070       <itemizedlist>
3071           <listitem>
3072             <para>Distribute user home directories into multiple
3073             directories that reflect organizational divisions, such as
3074             academic or corporate departments. For example, a company can
3075             create group directories called <emphasis
3076             role="bold">usr/marketing</emphasis>, <emphasis
3077             role="bold">usr/research</emphasis>, <emphasis
3078             role="bold">usr/finance</emphasis>. A good feature of this
3079             scheme is that knowing a user's department is enough to find
3080             the user's home directory. Also, it makes it easy to set the
3081             ACL to limit access to members of the department only. A
3082             potential drawback arises if departments are of sufficiently
3083             unequal size that users in large departments experience slower
3084             lookup than users in small departments. This scheme is also
3085             not appropriate in cells where users frequently change between
3086             divisions.</para>
3087           </listitem>
3088
3089           <listitem>
3090             <para>Distribute home directories into alphabetic
3091             subdirectories of the <emphasis role="bold">usr</emphasis>
3092             directory (the <emphasis role="bold">usr/a</emphasis>
3093             subdirectory, the <emphasis role="bold">usr/b</emphasis>
3094             subdirectory, and so on), based on the first letter of the
3095             username. If the cell is very large, create subdirectories
3096             under each letter that correspond to the second letter in the
3097             user name. This scheme has the same advantages and
3098             disadvantages of a department-based scheme. Anyone who knows
3099             the user's username can find the user's home directory, but
3100             users with names that begin with popular letters sometimes
3101             experience slower lookup.</para>
3102           </listitem>
3103
3104           <listitem>
3105             <para>Distribute home directories randomly but evenly into
3106             more than one grouping directory. One cell that uses this
3107             scheme has over twenty such directories called the <emphasis
3108             role="bold">usr1</emphasis> directory, the <emphasis
3109             role="bold">usr2</emphasis> directory, and so on. This scheme
3110             is especially appropriate in cells where the other two schemes
3111             do not seem feasible. It eliminates the potential problem of
3112             differences in lookup speed, because all directories are about
3113             the same size. Its disadvantage is that there is no way to
3114             guess which directory a given user's volume is mounted in, but
3115             a solution is to create a symbolic link in the regular
3116             <emphasis role="bold">usr</emphasis> directory that references
3117             the actual mount point. For example, if user <emphasis
3118             role="bold">smith</emphasis>'s volume is mounted at the
3119             <emphasis
3120             role="bold">/afs/bigcell.example.com/usr17/smith</emphasis>
3121             directory, then the <emphasis
3122             role="bold">/afs/bigcell.example.com/usr/smith</emphasis>
3123             directory is a symbolic link to the <emphasis
3124             role="bold">../usr17/smith</emphasis> directory. This way, if
3125             someone does not know which directory the user <emphasis
3126             role="bold">smith</emphasis> is in, he or she can access it
3127             through the link called <emphasis
3128             role="bold">usr/smith</emphasis>; people who do know the
3129             appropriate directory save lookup time by specifying
3130             it.</para>
3131           </listitem>
3132       </itemizedlist>
3133       </para>
3134
3135       <para>For instructions on how to implement the various schemes when
3136       using the <emphasis role="bold">uss</emphasis> program to create
3137       user accounts, see <link linkend="HDRWQ472">Evenly Distributing User
3138       Home Directories with the G Instruction</link> and <link
3139       linkend="HDRWQ473">Creating a Volume with the V
3140       Instruction</link>.</para>
3141     </sect2>
3142
3143     <sect2 id="Header_72">
3144       <title>Making a Backup Version of User Volumes Available</title>
3145
3146       <para>Mounting the backup version of a user's volume is a simple way
3147       to enable users themselves to restore data they have accidentally
3148       removed or deleted. It is conventional to mount the backup version
3149       at a subdirectory of the user's home directory (called perhaps the
3150       <emphasis role="bold">OldFiles</emphasis> subdirectory), but other
3151       schemes are possible. Once per day you create a new backup version
3152       to capture the changes made that day, overwriting the previous day's
3153       backup version with the new one. Users can always retrieve the
3154       previous day's copy of a file without your assistance, freeing you
3155       to deal with more pressing tasks.</para>
3156
3157       <para>Users sometimes want to delete the mount point to their backup
3158       volume, because they erroneously believe that the backup volume's
3159       contents count against their quota. Remind them that the backup
3160       volume is separate, so the only space it uses in the user volume is
3161       the amount needed for the mount point.</para>
3162
3163       <para>For further discussion of backup volumes, see <link
3164       linkend="HDRWQ77">Backing Up AFS Data</link> and <link
3165       linkend="HDRWQ201">Creating Backup Volumes</link>.</para>
3166
3167       <indexterm>
3168         <primary>file</primary>
3169
3170         <secondary>creating standard ones in new user account</secondary>
3171       </indexterm>
3172
3173       <indexterm>
3174         <primary>user account</primary>
3175
3176         <secondary>creating</secondary>
3177
3178         <tertiary>standard files in</tertiary>
3179       </indexterm>
3180
3181       <indexterm>
3182         <primary>creating</primary>
3183
3184         <secondary>standard files in new user account</secondary>
3185       </indexterm>
3186     </sect2>
3187
3188     <sect2 id="HDRWQ60">
3189       <title>Creating Standard Files in New AFS Accounts</title>
3190
3191       <para>From your experience as a UNIX administrator, you are probably
3192       familiar with the use of login and shell initialization files (such
3193       as the <emphasis role="bold">.login</emphasis> and <emphasis
3194       role="bold">.cshrc</emphasis> files) to make an account easier to
3195       use.</para>
3196
3197       <para>It is often practical to add some AFS-specific directories to
3198       the definition of the user's <envar>PATH</envar> environment
3199       variable, including the following:
3200       <itemizedlist>
3201           <listitem>
3202             <para>The path to a <emphasis role="bold">bin</emphasis>
3203             subdirectory in the user's home directory for binaries the
3204             user has created (that is, <emphasis
3205             role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
3206             role="bold">/usr/</emphasis><replaceable>username</replaceable><emphasis
3207             role="bold">/bin</emphasis>)</para>
3208           </listitem>
3209
3210           <listitem>
3211             <para>The <emphasis role="bold">/usr/afsws/bin</emphasis>
3212             path, which conventionally includes programs like <emphasis
3213             role="bold">fs</emphasis>, <emphasis
3214             role="bold">klog</emphasis>, <emphasis
3215             role="bold">kpasswd</emphasis>, <emphasis
3216             role="bold">pts</emphasis>, <emphasis
3217             role="bold">tokens</emphasis>, and <emphasis
3218             role="bold">unlog</emphasis></para>
3219           </listitem>
3220
3221           <listitem>
3222             <para>The <emphasis role="bold">/usr/afsws/etc</emphasis>
3223             path, if the user is an administrator; it usually houses the
3224             AFS command suites that require privilege (the <emphasis
3225             role="bold">backup</emphasis>, <emphasis
3226             role="bold">butc</emphasis>, <emphasis
3227             role="bold">kas</emphasis>, <emphasis
3228             role="bold">uss</emphasis>, <emphasis
3229             role="bold">vos</emphasis> commands), and others.</para>
3230           </listitem>
3231       </itemizedlist>
3232       </para>
3233
3234       <para>If you are not using an AFS-modified login utility, it can be
3235       helpful to users to invoke the <emphasis role="bold">klog</emphasis>
3236       command in their <emphasis role="bold">.login</emphasis> file so
3237       that they obtain AFS tokens as part of logging in. In the following
3238       example command sequence, the first line echoes the string
3239       <computeroutput>klog</computeroutput> to the standard output stream,
3240       so that the user understands the purpose of the
3241       <computeroutput>Password:</computeroutput> prompt that appears when
3242       the second line is executed. The <emphasis
3243       role="bold">-setpag</emphasis> flag associates the new tokens with a
3244       process authentication group (PAG), which is discussed further in
3245       <link linkend="HDRWQ64">Identifying AFS Tokens by PAG</link>.</para>
3246
3247 <programlisting>
3248     echo -n "klog " klog -setpag
3249 </programlisting>
3250
3251       <para>The following sequence of commands has a similar effect,
3252       except that the <emphasis role="bold">pagsh</emphasis> command forks
3253       a new shell with which the PAG and tokens are associated.</para>
3254
3255 <programlisting>
3256     pagsh echo -n "klog " klog
3257 </programlisting>
3258
3259       <para>If you use an AFS-modified login utility, this sequence is not
3260       necessary, because such utilities both log a user in locally and
3261       obtain AFS tokens.</para>
3262
3263       <indexterm>
3264         <primary>group</primary>
3265
3266         <secondary>AFS GID</secondary>
3267       </indexterm>
3268
3269       <indexterm>
3270         <primary>group</primary>
3271
3272         <secondary>restrictions</secondary>
3273       </indexterm>
3274
3275       <indexterm>
3276         <primary>group</primary>
3277
3278         <secondary>privacy flags</secondary>
3279       </indexterm>
3280
3281       <indexterm>
3282         <primary>privacy flags on Protection Database entry</primary>
3283       </indexterm>
3284     </sect2>
3285   </sect1>
3286
3287   <sect1 id="HDRWQ61">
3288     <title>Using AFS Protection Groups</title>
3289
3290     <para>AFS enables users to define their own groups of other users or
3291     machines. The groups are placed on ACLs to grant the same permissions
3292     to many users without listing each user individually. For group
3293     creation instructions, see <link linkend="HDRWQ531">Administering the
3294     Protection Database</link>.</para>
3295
3296     <para>Groups have AFS ID numbers, just as users do, but an AFS group
3297     ID (GID) is a negative integer whereas a user's AFS UID is a positive
3298     integer. By default, the Protection Server allocates a new group's AFS
3299     GID automatically, but members of the <emphasis
3300     role="bold">system:administrators</emphasis> group can assign a GID
3301     when issuing the <emphasis role="bold">pts creategroup</emphasis>
3302     command. Before explicitly assigning a GID, it is best to verify that
3303     it is not already in use.</para>
3304
3305     <para>A group cannot belong to another group, but it can own another
3306     group or even itself as long as it (the owning group) has at least one
3307     member. The current owner of a group can transfer ownership of the
3308     group to another user or group, even without the new owner's
3309     permission. At that point the former owner loses administrative
3310     control over the group.</para>
3311
3312     <para>By default, each user can create 20 groups. A system
3313     administrator can increase or decrease this group creation quota with
3314     the <emphasis role="bold">pts setfields</emphasis> command.</para>
3315
3316     <para>Each Protection Database entry (group or user) is protected by a
3317     set of five privacy flagswhich limit who can administer the entry and
3318     what they can do. The default privacy flags are fairly restrictive,
3319     especially for user entries. See <link linkend="HDRWQ559">Setting the
3320     Privacy Flags on Database Entries</link>.</para>
3321
3322     <indexterm>
3323       <primary>system:administrators group</primary>
3324
3325       <secondary>about</secondary>
3326     </indexterm>
3327
3328     <indexterm>
3329       <primary>system:anyuser group</primary>
3330
3331       <secondary>about</secondary>
3332     </indexterm>
3333
3334     <indexterm>
3335       <primary>system:authuser group</primary>
3336
3337       <secondary>about</secondary>
3338     </indexterm>
3339
3340     <indexterm>
3341       <primary>group</primary>
3342
3343       <secondary>system-defined</secondary>
3344     </indexterm>
3345
3346     <sect2 id="Header_75">
3347       <title>The Three System Groups</title>
3348
3349       <para>As the Protection Server initializes for the first time on a
3350       cell's first database server machine, it automatically creates three
3351       group entries: the <emphasis role="bold">system:anyuser</emphasis>,
3352       <emphasis role="bold">system:authuser</emphasis>, and <emphasis
3353       role="bold">system:administrators</emphasis> groups.</para>
3354
3355       <indexterm>
3356         <primary>AFS UID</primary>
3357
3358         <secondary>reserved</secondary>
3359
3360         <tertiary>system-defined groups</tertiary>
3361       </indexterm>
3362
3363       <para>The first two system groups are unlike any other groups in the
3364       Protection Database in that they do not have a stable membership:
3365       <itemizedlist>
3366           <listitem>
3367             <para>The <emphasis role="bold">system:anyuser</emphasis>
3368             group includes everyone who can access a cell's AFS filespace:
3369             users who have tokens for the local cell, users who have
3370             logged in on a local AFS client machine but not obtained
3371             tokens (such as the local superuser <emphasis
3372             role="bold">root</emphasis>), and users who have connected to
3373             a local machine from outside the cell. Placing the <emphasis
3374             role="bold">system:anyuser</emphasis> group on an ACL grants
3375             access to the widest possible range of users. It is the only
3376             way to extend access to users from foreign AFS cells that do
3377             not have local accounts.</para>
3378           </listitem>
3379
3380           <listitem>
3381             <para>The <emphasis role="bold">system:authuser</emphasis>
3382             group includes everyone who has a valid token obtained from
3383             the cell's AFS authentication service.</para>
3384           </listitem>
3385       </itemizedlist>
3386       </para>
3387
3388       <para>Because the groups do not have a stable membership, the
3389       <emphasis role="bold">pts membership</emphasis> command produces no
3390       output for them. Similarly, they do not appear in the list of groups
3391       to which a user belongs.</para>
3392
3393       <para>The <emphasis role="bold">system:administrators</emphasis>
3394       group does have a stable membership, consisting of the cell's
3395       privileged administrators. Members of this group can issue any
3396       <emphasis role="bold">pts</emphasis> command, and are the only ones
3397       who can issue several other restricted commands (such as the
3398       <emphasis role="bold">chown</emphasis> command on AFS files). By
3399       default, they also implicitly have the <emphasis
3400       role="bold">a</emphasis> (<emphasis
3401       role="bold">administer</emphasis>) and <emphasis
3402       role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>)
3403       permissions on every ACL in the filespace. For information about
3404       changing this default, see <link linkend="HDRWQ586">Administering
3405       the system:administrators Group</link>.</para>
3406
3407       <para>For a discussion of how to use system groups effectively on
3408       ACLs, see <link linkend="HDRWQ571">Using Groups on
3409       ACLs</link>.</para>
3410     </sect2>
3411
3412     <sect2 id="HDRWQ62">
3413       <title>The Two Types of User-Defined Groups</title>
3414
3415       <para>All users can create regular groups. A regular group name has
3416       two fields separated by a colon, the first of which must indicate
3417       the group's ownership. The Protection Server refuses to create or
3418       change the name of a group if the result does not accurately
3419       indicate the ownership.</para>
3420
3421       <para>Members of the <emphasis
3422       role="bold">system:administrators</emphasis> group can create
3423       prefix-less groups whose names do not have the first field that
3424       indicates ownership. For suggestions on using the two types of
3425       groups effectively, see <link linkend="HDRWQ545">Using Groups
3426       Effectively</link>.</para>
3427
3428       <indexterm>
3429         <primary>authentication</primary>
3430
3431         <secondary>AFS separate from UNIX</secondary>
3432       </indexterm>
3433
3434       <indexterm>
3435         <primary>AFS</primary>
3436
3437         <secondary>authentication separate from UNIX</secondary>
3438       </indexterm>
3439     </sect2>
3440   </sect1>
3441
3442   <sect1 id="HDRWQ63">
3443     <title>Login and Authentication in AFS</title>
3444
3445     <para>As explained in <link linkend="HDRWQ31">Differences in
3446     Authentication</link>, AFS authentication is separate from UNIX
3447     authentication because the two file systems are separate. The
3448     separation has two practical implications:
3449     <itemizedlist>
3450         <listitem>
3451           <para>To access AFS files, users must both log into the local
3452           file system and authenticate with the AFS authentication
3453           service. (Logging into the local file system is necessary
3454           because the only way to access the AFS filespace is through a
3455           Cache Manager, which resides in the local machine's
3456           kernel.)</para>
3457         </listitem>
3458
3459         <listitem>
3460           <para>Passwords are stored in two separate places: in the
3461           Kerberos Database for AFS and in the each machine's local
3462           password file (the <emphasis role="bold">/etc/passwd</emphasis>
3463           file or equivalent) for the local file system.</para>
3464         </listitem>
3465     </itemizedlist>
3466     </para>
3467
3468     <para>When a user successfully authenticates, the AFS authentication
3469     service passes a token to the user's Cache Manager. The token is a
3470     small collection of data that certifies that the user has correctly
3471     provided the password associated with a particular AFS identity. The
3472     Cache Manager presents the token to AFS server processes along with
3473     service requests, as proof that the user is genuine. To learn about
3474     the mutual authentication procedure they use to establish identity,
3475     see <link linkend="HDRWQ75">A More Detailed Look at Mutual
3476     Authentication</link>.</para>
3477
3478     <para>The Cache Manager stores tokens in the user's credential
3479     structure in kernel memory. To distinguish one user's credential
3480     structure from another's, the Cache Manager identifies each one either
3481     by the user's UNIX UID or by a process authentication group (PAG),
3482     which is an identification number guaranteed to be unique in the
3483     cell. For further discussion, see <link linkend="HDRWQ64">Identifying
3484     AFS Tokens by PAG</link>.</para>
3485
3486     <indexterm>
3487       <primary>tokens</primary>
3488
3489       <secondary>one-per-cell rule</secondary>
3490     </indexterm>
3491
3492     <para>A user can have only one token per cell in each separately
3493     identified credential structure. To obtain a second token for the same
3494     cell, the user must either log into a different machine or obtain
3495     another credential structure with a different identifier than any
3496     existing credential structure, which is most easily accomplished by
3497     issuing the <emphasis role="bold">pagsh</emphasis> command (see <link
3498     linkend="HDRWQ64">Identifying AFS Tokens by PAG</link>). In a single
3499     credential structure, a user can have one token for each of many cells
3500     at the same time. As this implies, authentication status on one
3501     machine or PAG is independent of authentication status on another
3502     machine or PAG, which can be very useful to a user or system
3503     administrator.</para>
3504
3505     <para>The AFS distribution includes library files that enable each
3506     system type's login utility to authenticate users with AFS and log
3507     them into the local file system in one step. If you do not configure
3508     an AFS-modified login utility on a client machine, its users must
3509     issue the <emphasis role="bold">klog</emphasis> command to
3510     authenticate with AFS after logging in.</para>
3511
3512     <note>
3513       <para>The AFS-modified libraries do not necessarily support all
3514       features available in an operating system's proprietary login
3515       utility. In some cases, it is not possible to support a utility at
3516       all. For more information about the supported utilities in each AFS
3517       version, see the OpenAFS Release Notes.</para>
3518     </note>
3519
3520     <indexterm>
3521       <primary>commands</primary>
3522
3523       <secondary>pagsh</secondary>
3524     </indexterm>
3525
3526     <indexterm>
3527       <primary>pagsh command</primary>
3528     </indexterm>
3529
3530     <indexterm>
3531       <primary>commands</primary>
3532
3533       <secondary>klog with -setpag flag</secondary>
3534     </indexterm>
3535
3536     <indexterm>
3537       <primary>klog command</primary>
3538
3539       <secondary>with -setpag flag</secondary>
3540     </indexterm>
3541
3542     <indexterm>
3543       <primary>PAG</primary>
3544
3545       <secondary>creating with klog or pagsh command</secondary>
3546     </indexterm>
3547
3548     <indexterm>
3549       <primary>creating</primary>
3550
3551       <secondary>PAG with klog or pagsh command</secondary>
3552     </indexterm>
3553
3554     <indexterm>
3555       <primary>process authentication group</primary>
3556
3557       <secondary></secondary>
3558
3559       <see>PAG</see>
3560     </indexterm>
3561
3562     <sect2 id="HDRWQ64">
3563       <title>Identifying AFS Tokens by PAG</title>
3564
3565       <para>As noted, the Cache Manager identifies user credential
3566       structures either by UNIX UID or by PAG. Using a PAG is preferable
3567       because it guaranteed to be unique: the Cache Manager allocates it
3568       based on a counter that increments with each use. In contrast,
3569       multiple users on a machine can share or assume the same UNIX UID,
3570       which creates potential security problems. The following are two
3571       common such situations:
3572       <itemizedlist>
3573           <listitem>
3574             <para>The local superuser <emphasis
3575             role="bold">root</emphasis> can always assume any other user's
3576             UNIX UID simply by issuing the <emphasis
3577             role="bold">su</emphasis> command, without providing the
3578             user's password. If the credential structure is associated
3579             with the user's UNIX UID, then assuming the UID means
3580             inheriting the AFS tokens.</para>
3581           </listitem>
3582
3583           <listitem>
3584             <para>Two users working on different NFS client machines can
3585             have the same UNIX UID in their respective local file
3586             systems. If they both access the same NFS/AFS Translator
3587             machine, and the Cache Manager there identifies them by their
3588             UNIX UID, they become indistinguishable. To eliminate this
3589             problem, the Cache Manager on a translator machine
3590             automatically generates a PAG for each user and uses it,
3591             rather than the UNIX UID, to tell users apart.</para>
3592           </listitem>
3593       </itemizedlist>
3594       </para>
3595
3596       <para>Yet another advantage of PAGs over UIDs is that processes
3597       spawned by the user inherit the PAG and so share the token; thus
3598       they gain access to AFS as the authenticated user. In many
3599       environments, for example, printer and other daemons run under
3600       identities (such as the local superuser <emphasis
3601       role="bold">root</emphasis>) that the AFS server processes recognize
3602       only as the <emphasis role="bold">anonymous</emphasis> user. Unless
3603       PAGs are used, such daemons cannot access files for which the
3604       <emphasis role="bold">system:anyuser</emphasis> group does not have
3605       the necessary ACL permissions.</para>
3606
3607       <para>Once a user has a PAG, any new tokens the user obtains are
3608       associated with the PAG. The PAG expires two hours after any
3609       associated tokens expire or are discarded. If the user issues the
3610       <emphasis role="bold">klog</emphasis> command before the PAG
3611       expires, the new token is associated with the existing PAG (the PAG
3612       is said to be recycled in this case).</para>
3613
3614       <para>AFS-modified login utilities automatically generate a PAG, as
3615       described in the following section. If you use a standard login
3616       utility, your users must issue the <emphasis
3617       role="bold">pagsh</emphasis> command before the <emphasis
3618       role="bold">klog</emphasis> command, or include the latter command's
3619       <emphasis role="bold">-setpag</emphasis> flag. For instructions, see
3620       <link linkend="HDRWQ69">Using Two-Step Login and
3621       Authentication</link>.</para>
3622
3623       <para>Users can also use either command at any time to create a new
3624       PAG. The difference between the two commands is that the <emphasis
3625       role="bold">klog</emphasis> command replaces the PAG associated with
3626       the current command shell and tokens. The <emphasis
3627       role="bold">pagsh</emphasis> command initializes a new command shell
3628       before creating a new PAG. If the user already had a PAG, any
3629       running processes or jobs continue to use the tokens associated with
3630       the old PAG whereas any new jobs or processes use the new PAG and
3631       its associated tokens. When you exit the new shell (by pressing
3632       &lt;<emphasis role="bold">Ctrl-d</emphasis>&gt;, for example), you
3633       return to the original PAG and shell. By default, the <emphasis
3634       role="bold">pagsh</emphasis> command initializes a Bourne shell, but
3635       you can include the <emphasis role="bold">-c</emphasis> argument to
3636       initialize a C shell (the <emphasis role="bold">/bin/csh</emphasis>
3637       program on many system types) or Korn shell (the <emphasis
3638       role="bold">/bin/ksh</emphasis> program) instead.</para>
3639
3640       <indexterm>
3641         <primary>login utility</primary>
3642
3643         <secondary>AFS version</secondary>
3644       </indexterm>
3645     </sect2>
3646
3647     <sect2 id="HDRWQ65">
3648       <title>Using an AFS-modified login Utility</title>
3649
3650       <para>As previously mentioned, an AFS-modified login utility
3651       simultaneously obtains an AFS token and logs the user into the local
3652       file system. This section outlines the login and authentication
3653       process and its interaction with the value in the password field of
3654       the local password file.</para>
3655
3656       <para>An AFS-modified login utility performs a sequence of steps
3657       similar to the following; details can vary for different operating
3658       systems:
3659       <orderedlist>
3660           <listitem>
3661             <para>It checks the user's entry in the local password file
3662             (the <emphasis role="bold">/etc/passwd</emphasis> file or
3663             equivalent).</para>
3664           </listitem>
3665
3666           <listitem>
3667             <para>If no entry exists, or if an asterisk
3668             (<computeroutput>*</computeroutput>) appears in the entry's
3669             password field, the login attempt fails. If the entry exists,
3670             the attempt proceeds to the next step.</para>
3671           </listitem>
3672
3673           <listitem id="LIWQ66">
3674             <para>The utility obtains a PAG.</para>
3675           </listitem>
3676
3677           <listitem id="LIWQ67">
3678             <para>The utility converts the password
3679             provided by the user into an encryption key and encrypts a
3680             packet of data with the key. It sends the packet to the AFS
3681             authentication service (the AFS Authentication Server in the
3682             conventional configuration).</para>
3683           </listitem>
3684
3685           <listitem>
3686             <para>The authentication service decrypts the packet and,
3687             depending on the success of the decryption, judges the
3688             password to be correct or incorrect. (For more details, see
3689             <link linkend="HDRWQ75">A More Detailed Look at Mutual
3690             Authentication</link>.)
3691             <itemizedlist>
3692                 <listitem>
3693                   <para>If the authentication service judges the password
3694                   incorrect, the user does not receive an AFS token. The
3695                   PAG is retained, ready to be associated with any tokens
3696                   obtained later. The attempt proceeds to Step <link
3697                   linkend="LIWQ68">6</link>.</para>
3698                 </listitem>
3699
3700                 <listitem>
3701                   <para>If the authentication service judges the password
3702                   correct, it issues a token to the user as proof of AFS
3703                   authentication. The login utility logs the user into the
3704                   local UNIX file system. Some login utilities echo the
3705                   following banner to the screen to alert the user to
3706                   authentication with AFS. Step <link
3707                   linkend="LIWQ68">6</link> is skipped.
3708 <programlisting>
3709      AFS(R) version Login
3710 </programlisting>
3711                   </para>
3712                 </listitem>
3713             </itemizedlist>
3714             </para>
3715           </listitem>
3716
3717           <listitem id="LIWQ68">
3718             <para>If no AFS token was granted in
3719             Step <link linkend="LIWQ67">4</link>, the login utility
3720             attempts to log the user into the local file system, by
3721             comparing the password provided to the local password file.
3722             <itemizedlist>
3723                 <listitem>
3724                   <para>If the password is incorrect or any value other
3725                   than an encrypted 13-character string appears in the
3726                   password field, the login attempt fails.</para>
3727                 </listitem>
3728
3729                 <listitem>
3730                   <para>If the password is correct, the user is logged
3731                 into the local file system only.</para> </listitem>
3732             </itemizedlist>
3733           </para>
3734           </listitem>
3735       </orderedlist>
3736       </para>
3737
3738       <indexterm>
3739         <primary>local password file</primary>
3740
3741         <secondary>when using AFS--modified login utility</secondary>
3742       </indexterm>
3743
3744       <indexterm>
3745         <primary>login utility</primary>
3746
3747         <secondary>AFS version's interaction with local password
3748         file</secondary>
3749       </indexterm>
3750
3751       <indexterm>
3752         <primary>password</primary>
3753
3754         <secondary>local password file</secondary>
3755       </indexterm>
3756
3757       <para>As indicated, when you use an AFS-modified login utility, the
3758       password field in the local password file is no longer the primary
3759       gate for access to your system. If the user provides the correct AFS
3760       password, then the program never consults the local password
3761       file. However, you can still use the password field to control
3762       access, in the following way:
3763       <itemizedlist>
3764           <listitem>
3765             <para>To prevent both local login and AFS authentication,
3766             place an asterisk (<emphasis role="bold">*</emphasis>) in the
3767             field. This is useful mainly in emergencies, when you want to
3768             prevent a certain user from logging into the machine.</para>
3769           </listitem>
3770
3771           <listitem>
3772             <para>To prevent login to the local file system if the user
3773             does not provide the correct AFS password, place a character
3774             string of any length other than the standard thirteen
3775             characters in the field. This is appropriate if you want to
3776             permit only people with local AFS accounts to login on your
3777             machines. A single <emphasis role="bold">X</emphasis> or other
3778             character is the most easily recognizable way to do
3779             this.</para>
3780           </listitem>
3781
3782           <listitem>
3783             <para>To enable a user to log into the local file system even
3784             after providing an incorrect AFS password, record a standard
3785             UNIX encrypted password in the field by issuing the standard
3786             UNIX password-setting command (<emphasis
3787             role="bold">passwd</emphasis> or equivalent).</para>
3788           </listitem>
3789       </itemizedlist>
3790       </para>
3791
3792       <para>Systems that use a Pluggable Authentication Module (PAM) for
3793       login and AFS authentication do not necessarily consult the local
3794       password file at all, in which case they do not use the password
3795       field to control authentication and login attempts.  Instead,
3796       instructions in the PAM configuration file (on many system types,
3797       <emphasis role="bold">/etc/pam.conf</emphasis>) fill the same
3798       function. See the instructions in the OpenAFS Quick Beginnings for
3799       installing AFS-modified login utilities.</para>
3800
3801       <indexterm>
3802         <primary>local password file</primary>
3803
3804         <secondary>when not using AFS-modified login utility</secondary>
3805       </indexterm>
3806     </sect2>
3807
3808     <sect2 id="HDRWQ69">
3809       <title>Using Two-Step Login and Authentication</title>
3810
3811       <para>In cells that do not use an AFS-modified login utility, users
3812       must issue separate commands to login and authenticate, as detailed
3813       in the OpenAFS User Guide:
3814       <orderedlist>
3815           <listitem>
3816             <para>They use the standard <emphasis
3817             role="bold">login</emphasis> program to login to the local
3818             file system, providing the password listed in the local
3819             password file (the <emphasis
3820             role="bold">/etc/passwd</emphasis> file or equivalent).</para>
3821           </listitem>
3822
3823           <listitem>
3824             <para>They must issue the <emphasis
3825             role="bold">klog</emphasis> command to authenticate with the
3826             AFS authentication service, including its <emphasis
3827             role="bold">-setpag</emphasis> flag to associate the new
3828             tokens with a process authentication group (PAG).</para>
3829           </listitem>
3830       </orderedlist>
3831       </para>
3832
3833       <para>As mentioned in <link linkend="HDRWQ60">Creating Standard
3834       Files in New AFS Accounts</link>, you can invoke the <emphasis
3835       role="bold">klog -setpag</emphasis> command in a user's <emphasis
3836       role="bold">.login</emphasis> file (or equivalent) so that the user
3837       does not have to remember to issue the command after logging in. The
3838       user still must type a password twice, once at the prompt generated
3839       by the login utility and once at the <emphasis
3840       role="bold">klog</emphasis> command's prompt. This implies that the
3841       two passwords can differ, but it is less confusing if they do
3842       not.</para>
3843
3844       <para>Another effect of not using an AFS-modified login utility is
3845       that the AFS servers recognize the standard <emphasis
3846       role="bold">login</emphasis> program as the <emphasis
3847       role="bold">anonymous</emphasis> user. If the <emphasis
3848       role="bold">login</emphasis> program needs to access any AFS files
3849       (such as the <emphasis role="bold">.login</emphasis> file in a
3850       user's home directory), then the ACL that protects the file must
3851       include an entry granting the <emphasis role="bold">l</emphasis>
3852       (<emphasis role="bold">lookup</emphasis>) and <emphasis
3853       role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>)
3854       permissions to the <emphasis role="bold">system:anyuser</emphasis>
3855       group.</para>
3856
3857       <para>When you do not use an AFS-modified login utility, an actual
3858       (scrambled) password must appear in the local password file for each
3859       user. Use the <emphasis role="bold">/bin/passwd</emphasis> file to
3860       insert or change these passwords. It is simpler if the password in
3861       the local password file matches the AFS password, but it is not
3862       required.</para>
3863
3864       <indexterm>
3865         <primary>tokens</primary>
3866
3867         <secondary>displaying for user</secondary>
3868       </indexterm>
3869
3870       <indexterm>
3871         <primary>tokens</primary>
3872
3873         <secondary>command</secondary>
3874       </indexterm>
3875
3876       <indexterm>
3877         <primary>commands</primary>
3878
3879         <secondary>tokens</secondary>
3880       </indexterm>
3881
3882       <indexterm>
3883         <primary>listing</primary>
3884
3885         <secondary>tokens held by issuer</secondary>
3886       </indexterm>
3887
3888       <indexterm>
3889         <primary>commands</primary>
3890
3891         <secondary>klog</secondary>
3892       </indexterm>
3893
3894       <indexterm>
3895         <primary>klog command</primary>
3896       </indexterm>
3897
3898       <indexterm>
3899         <primary>server process</primary>
3900
3901         <secondary>creating ticket (tokens) for</secondary>
3902       </indexterm>
3903
3904       <indexterm>
3905         <primary>tickets</primary>
3906
3907         <secondary></secondary>
3908
3909         <see>tokens</see>
3910       </indexterm>
3911
3912       <indexterm>
3913         <primary>tokens</primary>
3914
3915         <secondary>creating for server process</secondary>
3916       </indexterm>
3917
3918       <indexterm>
3919         <primary>authenticated identity</primary>
3920
3921         <secondary>acquiring with klog command</secondary>
3922       </indexterm>
3923
3924       <indexterm>
3925         <primary>unlog command</primary>
3926       </indexterm>
3927
3928       <indexterm>
3929         <primary>commands</primary>
3930
3931         <secondary>unlog</secondary>
3932       </indexterm>
3933
3934       <indexterm>
3935         <primary>discarding</primary>
3936
3937         <secondary>tokens</secondary>
3938       </indexterm>
3939
3940       <indexterm>
3941         <primary>tokens</primary>
3942
3943         <secondary>discarding with unlog command</secondary>
3944       </indexterm>
3945     </sect2>
3946
3947     <sect2 id="Header_81">
3948       <title>Obtaining, Displaying, and Discarding Tokens</title>
3949
3950       <para>Once logged in, a user can obtain a token at any time with the
3951       <emphasis role="bold">klog</emphasis> command. If a valid token
3952       already exists, the new one overwrites it. If a PAG already exists,
3953       the new token is associated with it.</para>
3954
3955       <para>By default, the <emphasis role="bold">klog</emphasis> command
3956       authenticates the issuer using the identity currently logged in to
3957       the local file system. To authenticate as a different identity, use
3958       the <emphasis role="bold">-principal</emphasis> argument. To obtain
3959       a token for a foreign cell, use the <emphasis
3960       role="bold">-cell</emphasis> argument (it can be combined with the
3961       <emphasis role="bold">-principal</emphasis> argument). See the
3962       OpenAFS User Guide and the entry for the <emphasis
3963       role="bold">klog</emphasis> command in the OpenAFS Administration
3964       Reference.</para>
3965
3966       <para>To discard either all tokens or the token for a particular
3967       cell, issue the <emphasis role="bold">unlog</emphasis> command. The
3968       command affects only the tokens associated with the current command
3969       shell. See the OpenAFS User Guideand the entry for the <emphasis
3970       role="bold">unlog</emphasis> command in the OpenAFS Administration
3971       Reference.</para>
3972
3973       <para>To display the tokens associated with the current command
3974       shell, issue the <emphasis role="bold">tokens</emphasis>
3975       command. The following examples illustrate its output in various
3976       situations.</para>
3977
3978       <para>If the issuer is not authenticated in any cell:</para>
3979
3980 <programlisting>
3981    % <emphasis role="bold">tokens</emphasis>
3982    Tokens held by the Cache Manager:
3983           --End of list--
3984 </programlisting>
3985
3986       <para>The following shows the output for a user with AFS UID 1000 in
3987       the Example Corporation cell:</para>
3988
3989 <programlisting>
3990    % <emphasis role="bold">tokens</emphasis>
3991    Tokens held by the Cache Manager:
3992    User's (AFS ID 1000) tokens for afs@example.com  [Expires Jun  2 10:00]
3993        --End of list--
3994 </programlisting>
3995
3996       <para>The following shows the output for a user who is authenticated
3997       in Example Corporation cell, the Example Organization cell and the
3998       Example Network cell. The user has different AFS UIDs in the three
3999       cells. Tokens for the last cell are expired:</para>
4000
4001 <programlisting>
4002    % <emphasis role="bold">tokens</emphasis>
4003    Tokens held by the Cache Manager:
4004    User's (AFS ID 1000) tokens for afs@example.com  [Expires Jun  2 10:00]
4005    User's (AFS ID 4286) tokens for afs@example.org  [Expires Jun  3 1:34]
4006    User's (AFS ID 22) tokens for afs@example.net  [&gt;&gt;Expired&lt;&lt;]
4007        --End of list--
4008 </programlisting>
4009
4010       <para>The Kerberos version of the <emphasis
4011       role="bold">tokens</emphasis> command (the <emphasis
4012       role="bold">tokens.krb</emphasis> command), also reports information
4013       on the ticket-granting ticket, including the ticket's owner, the
4014       ticket-granting service, and the expiration date, as in the
4015       following example. Also see <link linkend="HDRWQ70">Support for
4016       Kerberos Authentication</link>.</para>
4017
4018 <programlisting>
4019    % <emphasis role="bold">tokens.krb</emphasis>
4020    Tokens held by the Cache Manager:
4021    User's (AFS ID 1000) tokens for afs@example.com [Expires Jun  2 10:00]
4022    User smith's tokens for krbtgt.EXAMPLE.COM@example.com [Expires Jun  2 10:00]
4023      --End of list--
4024 </programlisting>
4025     </sect2>
4026
4027     <sect2 id="Header_82">
4028       <title>Setting Default Token Lifetimes for Users</title>
4029
4030       <indexterm>
4031         <primary>tokens</primary>
4032
4033         <secondary>setting default lifetimes for users</secondary>
4034       </indexterm>
4035
4036       <para>The maximum lifetime of a user token is the smallest of the
4037       ticket lifetimes recorded in the following three Authentication
4038       Database entries. The <emphasis role="bold">kas examine</emphasis>
4039       command reports the lifetime as <computeroutput>Max ticket
4040       lifetime</computeroutput>. Administrators who have the
4041       <computeroutput>ADMIN</computeroutput> flag on their Authentication
4042       Database entry can use the <emphasis
4043       role="bold">-lifetime</emphasis> argument to the <emphasis
4044       role="bold">kas setfields</emphasis> command to set an entry's
4045       ticket lifetime.
4046       <itemizedlist>
4047           <listitem>
4048             <para>The <emphasis role="bold">afs</emphasis> entry, which
4049             corresponds to the AFS server processes. The default is 100
4050             hours.</para>
4051           </listitem>
4052
4053           <listitem>
4054             <para>The <emphasis role="bold">krbtgt</emphasis>.cellname
4055             entry, which corresponds to the ticket-granting ticket used
4056             internally in generating the token. The default is 720 hours
4057             (30 days).</para>
4058           </listitem>
4059
4060           <listitem>
4061             <para>The entry for the user of the AFS-modified login utility
4062             or issuer of the <emphasis role="bold">klog</emphasis>
4063             command. The default is 25 hours for user entries created
4064             using the AFS 3.1 or later version of the Authentication
4065             Server, and 100 hours for user entries created using the AFS
4066             3.0 version of the Authentication Server. A user can use the
4067             <emphasis role="bold">kas examine</emphasis> command to
4068             display his or her own Authentication Database entry.</para>
4069           </listitem>
4070       </itemizedlist>
4071       </para>
4072
4073       <note>
4074         <para>An AFS-modified login utility always grants a token with a
4075         lifetime calculated from the previously described three
4076         values. When issuing the <emphasis role="bold">klog</emphasis>
4077         command, a user can request a lifetime shorter than the default by
4078         using the <emphasis role="bold">-lifetime</emphasis> argument. For
4079         further information, see the OpenAFS User Guide and the <emphasis
4080         role="bold">klog</emphasis> reference page in the OpenAFS
4081         Administration Reference.</para>
4082       </note>
4083     </sect2>
4084
4085     <sect2 id="Header_83">
4086       <title>Changing Passwords</title>
4087
4088       <indexterm>
4089         <primary>password</primary>
4090
4091         <secondary>changing in AFS</secondary>
4092       </indexterm>
4093
4094       <indexterm>
4095         <primary>kpasswd command</primary>
4096       </indexterm>
4097
4098       <indexterm>
4099         <primary>commands</primary>
4100
4101         <secondary>kpasswd</secondary>
4102       </indexterm>
4103
4104       <indexterm>
4105         <primary>kas commands</primary>
4106
4107         <secondary>setpassword</secondary>
4108       </indexterm>
4109
4110       <indexterm>
4111         <primary>commands</primary>
4112
4113         <secondary>kas setpassword</secondary>
4114       </indexterm>
4115
4116       <para>Regular AFS users can change their own passwords by using
4117       either the <emphasis role="bold">kpasswd</emphasis> or <emphasis
4118       role="bold">kas setpassword</emphasis> command. The commands prompt
4119       for the current password and then twice for the new password, to
4120       screen out typing errors.</para>
4121
4122       <para>Administrators who have the
4123       <computeroutput>ADMIN</computeroutput> flag on their Authentication
4124       Database entries can change any user's password, either by using the
4125       <emphasis role="bold">kpasswd</emphasis> command (which requires
4126       knowing the current password) or the <emphasis role="bold">kas
4127       setpassword</emphasis> command.</para>
4128
4129       <para>If your cell does not use an AFS-modified login utility,
4130       remember also to change the local password, using the operating
4131       system's password-changing command. For more instructions on
4132       changing passwords, see <link linkend="HDRWQ516">Changing AFS
4133       Passwords</link>.</para>
4134     </sect2>
4135
4136     <sect2 id="Header_84">
4137       <title>Imposing Restrictions on Passwords and Authentication
4138       Attempts</title>
4139
4140       <para>You can help to make your cell more secure by imposing
4141       restrictions on user passwords and authentication attempts. To
4142       impose the restrictions as you create an account, use the <emphasis
4143       role="bold">A</emphasis> instruction in the <emphasis
4144       role="bold">uss</emphasis> template file as described in <link
4145       linkend="HDRWQ478">Increasing Account Security with the A
4146       Instruction</link>. To set or change the values on an existing
4147       account, use the <emphasis role="bold">kas setfields</emphasis>
4148       command as described in <link linkend="HDRWQ515">Improving Password
4149       and Authentication Security</link>.</para>
4150
4151       <indexterm>
4152         <primary>password</primary>
4153
4154         <secondary>expiration</secondary>
4155       </indexterm>
4156
4157       <indexterm>
4158         <primary>password</primary>
4159
4160         <secondary>lifetime</secondary>
4161       </indexterm>
4162
4163       <indexterm>
4164         <primary>kas commands</primary>
4165
4166         <secondary>setfields</secondary>
4167       </indexterm>
4168
4169       <indexterm>
4170         <primary>commands</primary>
4171
4172         <secondary>kas setfields</secondary>
4173       </indexterm>
4174
4175       <indexterm>
4176         <primary>Authentication Database</primary>
4177
4178         <secondary>password lifetime, setting</secondary>
4179       </indexterm>
4180
4181       <indexterm>
4182         <primary>password</primary>
4183
4184         <secondary>restricting reuse</secondary>
4185       </indexterm>
4186
4187       <para>By default, AFS passwords never expire. Limiting password
4188       lifetime can help improve security by decreasing the time the
4189       password is subject to cracking attempts. You can choose an lifetime
4190       from 1 to 254 days after the password was last changed.  It
4191       automatically applies to each new password as it is set. When the
4192       user changes passwords, you can also insist that the new password is
4193       not similar to any of the 20 passwords previously used.</para>
4194
4195       <indexterm>
4196         <primary>password</primary>
4197
4198         <secondary>consequences of multiple failed authentication
4199         attempts</secondary>
4200       </indexterm>
4201
4202       <indexterm>
4203         <primary>kas commands</primary>
4204
4205         <secondary>setfields</secondary>
4206       </indexterm>
4207
4208       <indexterm>
4209         <primary>commands</primary>
4210
4211         <secondary>kas setfields</secondary>
4212       </indexterm>
4213
4214       <indexterm>
4215         <primary>authentication</primary>
4216
4217         <secondary>consequences of multiple failures</secondary>
4218       </indexterm>
4219
4220       <para>Unscrupulous users can try to gain access to your AFS cell by
4221       guessing an authorized user's password. To protect against this type
4222       of attack, you can limit the number of times that a user can
4223       consecutively fail to provide the correct password.  When the limit
4224       is exceeded, the authentication service refuses further
4225       authentication attempts for a specified period of time (the lockout
4226       time). To reenable authentication attempts before the lockout time
4227       expires, an administrator must issue the <emphasis role="bold">kas
4228       unlock</emphasis> command.</para>
4229
4230       <indexterm>
4231         <primary>password</primary>
4232
4233         <secondary>checking quality of</secondary>
4234       </indexterm>
4235
4236       <indexterm>
4237         <primary>kpasswd command</primary>
4238       </indexterm>
4239
4240       <indexterm>
4241         <primary>commands</primary>
4242
4243         <secondary>kpasswd</secondary>
4244       </indexterm>
4245
4246       <indexterm>
4247         <primary>kas commands</primary>
4248
4249         <secondary>setpassword</secondary>
4250       </indexterm>
4251
4252       <indexterm>
4253         <primary>kpwvalid program</primary>
4254       </indexterm>
4255
4256       <para>In addition to settings on user's authentication accounts, you
4257       can improve security by automatically checking the quality of new
4258       user passwords. The <emphasis role="bold">kpasswd</emphasis> and
4259       <emphasis role="bold">kas setpassword</emphasis> commands pass the
4260       proposed password to a program or script called <emphasis
4261       role="bold">kpwvalid</emphasis>, if it exists. The <emphasis
4262       role="bold">kpwvalid</emphasis> performs quality checks and returns
4263       a code to indicate whether the password is acceptable. You can
4264       create your own program or modified the sample program included in
4265       the AFS distribution. See the <emphasis
4266       role="bold">kpwvalid</emphasis> reference page in the OpenAFS
4267       Administration Reference.</para>
4268
4269       <para>There are several types of quality checks that can improve
4270       password quality.
4271       <itemizedlist>
4272           <listitem>
4273             <para>The password is a minimum length</para>
4274           </listitem>
4275
4276           <listitem>
4277             <para>The password is not a word</para>
4278           </listitem>
4279
4280           <listitem>
4281             <para>The password contains both numbers and letters</para>
4282           </listitem>
4283       </itemizedlist>
4284       </para>
4285     </sect2>
4286
4287     <sect2 id="HDRWQ70">
4288       <title>Support for Kerberos Authentication</title>
4289
4290       <indexterm>
4291         <primary>Kerberos</primary>
4292
4293         <secondary>support for in AFS</secondary>
4294       </indexterm>
4295
4296       <indexterm>
4297         <primary>commands</primary>
4298
4299         <secondary>klog.krb</secondary>
4300       </indexterm>
4301
4302       <indexterm>
4303         <primary>commands</primary>
4304
4305         <secondary>pagsh.krb</secondary>
4306       </indexterm>
4307
4308       <indexterm>
4309         <primary>commands</primary>
4310
4311         <secondary>tokens.krb</secondary>
4312       </indexterm>
4313
4314       <indexterm>
4315         <primary>klog.krb command</primary>
4316       </indexterm>
4317
4318       <indexterm>
4319         <primary>pagsh.krb command</primary>
4320       </indexterm>
4321
4322       <indexterm>
4323         <primary>tokens.krb command</primary>
4324       </indexterm>
4325
4326       <para>If your site is using standard Kerberos authentication rather
4327       than the AFS Authentication Server, use the modified versions of the
4328       <emphasis role="bold">klog</emphasis>, <emphasis
4329       role="bold">pagsh</emphasis>, and <emphasis
4330       role="bold">tokens</emphasis> commands that support Kerberos
4331       authentication. The binaries for the modified version of these
4332       commands have the same name as the standard binaries with the
4333       addition of a <emphasis role="bold">.krb</emphasis>
4334       extension.</para>
4335
4336       <para>Use either the Kerberos version or the standard command
4337       throughout the cell; do not mix the two versions. AFS Product
4338       Support can provide instructions on installing the Kerberos version
4339       of these four commands. For information on the differences between
4340       the two versions of these commands, see the OpenAFS Administration
4341       Reference.</para>
4342     </sect2> </sect1>
4343
4344   <sect1 id="HDRWQ71">
4345     <title>Security and Authorization in AFS</title>
4346
4347     <para>AFS incorporates several features to ensure that only authorized
4348     users gain access to data. This section summarizes the most important
4349     of them and suggests methods for improving security in your
4350     cell.</para>
4351
4352     <sect2 id="HDRWQ72">
4353       <title>Some Important Security Features</title>
4354
4355       <indexterm>
4356         <primary>security</primary>
4357
4358         <secondary>AFS features</secondary>
4359       </indexterm>
4360
4361       <indexterm>
4362         <primary>AFS</primary>
4363
4364         <secondary>security features</secondary>
4365       </indexterm>
4366
4367       <formalpara>
4368         <title>ACLs on Directories</title>
4369
4370         <para>Files in AFS are protected by the access control list (ACL)
4371         associated with their parent directory. The ACL defines which
4372         users or groups can access the data in the directory, and in what
4373         way. See <link linkend="HDRWQ562">Managing Access Control
4374         Lists</link>.</para>
4375       </formalpara>
4376
4377       <formalpara>
4378         <title>Mutual Authentication Between Client and Server</title>
4379
4380         <para>When an AFS client and server process communicate, each
4381         requires the other to prove its identity during mutual
4382         authentication, which involves the exchange of encrypted
4383         information that only valid parties can decrypt and respond
4384         to. For a detailed description of the mutual authentication
4385         process, see <link linkend="HDRWQ75">A More Detailed Look at
4386         Mutual Authentication</link>.</para>
4387       </formalpara>
4388
4389       <para>AFS server processes mutually authenticate both with one
4390       another and with processes that represent human users. After mutual
4391       authentication is complete, the server and client have established
4392       an authenticated connection, across which they can communicate
4393       repeatedly without having to authenticate again until the connection
4394       expires or one of the parties closes it.  Authenticated connections
4395       have varying lifetimes.</para>
4396
4397       <formalpara>
4398         <title>Tokens</title>
4399
4400         <para>In order to access AFS files, users must prove their
4401         identities to the AFS authentication service by providing the
4402         correct AFS password. If the password is correct, the
4403         authentication service sends the user a token as evidence of
4404         authenticated status. See <link linkend="HDRWQ63">Login and
4405         Authentication in AFS</link>.</para>
4406       </formalpara>
4407
4408       <para>Servers assign the user identity <emphasis
4409       role="bold">anonymous</emphasis> to users and processes that do not
4410       have a valid token. The <emphasis role="bold">anonymous</emphasis>
4411       identity has only the access granted to the <emphasis
4412       role="bold">system:anyuser</emphasis> group on ACLs.</para>
4413
4414       <formalpara>
4415         <title>Authorization Checking</title>
4416
4417         <para>Mutual authentication establishes that two parties
4418         communicating with one another are actually who they claim to be.
4419         For many functions, AFS server processes also check that the
4420         client whose identity they have verified is also authorized to
4421         make the request. Different requests require different kinds of
4422         privilege. See <link linkend="HDRWQ73">Three Types of
4423         Privilege</link>.</para>
4424       </formalpara>
4425
4426       <formalpara>
4427         <title>Encrypted Network Communications</title>
4428
4429         <indexterm>
4430           <primary>network</primary>
4431
4432           <secondary>encrypted communication in AFS</secondary>
4433         </indexterm>
4434
4435         <indexterm>
4436           <primary>encrypted network communication</primary>
4437         </indexterm>
4438
4439         <indexterm>
4440           <primary>security</primary>
4441
4442           <secondary>encrypted network communication</secondary>
4443         </indexterm>
4444
4445         <para>The AFS server processes encrypt particularly sensitive
4446         information before sending it back to clients. Even if an
4447         unauthorized party is able to eavesdrop on an authenticated
4448         connection, they cannot decipher encrypted data without the proper
4449         key.</para>
4450       </formalpara>
4451
4452       <para>The following AFS commands encrypt data because they involve
4453       server encryption keys and passwords:
4454       <itemizedlist>
4455           <listitem>
4456             <para>The <emphasis role="bold">bos addkey</emphasis> command,
4457             which adds a server encryption key to the <emphasis
4458             role="bold">/usr/afs/etc/KeyFile</emphasis> file</para>
4459           </listitem>
4460
4461           <listitem>
4462             <para>The <emphasis role="bold">bos listkeys</emphasis>
4463             command, which lists the server encryption keys from the
4464             <emphasis role="bold">/usr/afs/etc/KeyFile</emphasis>
4465             file</para>
4466           </listitem>
4467
4468           <listitem>
4469             <para>The <emphasis role="bold">kpasswd</emphasis> command,
4470             which changes a password in the Authentication Database</para>
4471           </listitem>
4472
4473           <listitem>
4474             <para>Most commands in the <emphasis
4475             role="bold">kas</emphasis> command suite</para>
4476           </listitem>
4477       </itemizedlist>
4478       </para>
4479
4480       <para>In addition, the Update Server
4481       encrypts sensitive information (such as the contents of <emphasis
4482       role="bold">KeyFile</emphasis>) when distributing it. Other commands
4483       in the <emphasis role="bold">bos</emphasis> suite and the commands
4484       in the <emphasis role="bold">fs</emphasis>, <emphasis
4485       role="bold">pts</emphasis> and <emphasis role="bold">vos</emphasis>
4486       suites do not encrypt data before transmitting it.</para>
4487     </sect2>
4488
4489     <sect2 id="HDRWQ73">
4490       <title>Three Types of Privilege</title>
4491
4492       <para>AFS uses three separate types of privilege for the reasons
4493       discussed in <link linkend="HDRWQ585">The Reason for Separate
4494       Privileges</link>.
4495       <itemizedlist>
4496           <listitem>
4497             <para>Membership in the <emphasis
4498             role="bold">system:administrators</emphasis> group. Members
4499             are entitled to issue any <emphasis role="bold">pts</emphasis>
4500             command and those <emphasis role="bold">fs</emphasis> commands
4501             that set volume quota. By default, they also implicitly have
4502             the <emphasis role="bold">a</emphasis> (<emphasis
4503             role="bold">administer</emphasis>) and <emphasis
4504             role="bold">l</emphasis> (<emphasis
4505             role="bold">lookup</emphasis>) permissions on every ACL in the
4506             file tree even if the ACL does not include an entry for
4507             them.</para>
4508           </listitem>
4509
4510           <listitem>
4511             <para>The <computeroutput>ADMIN</computeroutput> flag on the
4512             Authentication Database entry. An administrator with this flag
4513             can issue any <emphasis role="bold">kas</emphasis>
4514             command.</para>
4515           </listitem>
4516
4517           <listitem>
4518             <para>Inclusion in the <emphasis
4519             role="bold">/usr/afs/etc/UserList</emphasis> file. An
4520             administrator whose username appears in this file can issue
4521             any <emphasis role="bold">bos</emphasis>, <emphasis
4522             role="bold">vos</emphasis>, or <emphasis
4523             role="bold">backup</emphasis> command (although some <emphasis
4524             role="bold">backup</emphasis> commands require additional
4525             privilege as described in <link linkend="HDRWQ260">Granting
4526             Administrative Privilege to Backup Operators</link>).</para>
4527           </listitem>
4528       </itemizedlist>
4529       </para>
4530     </sect2>
4531
4532     <sect2 id="Header_89">
4533       <title>Authorization Checking versus Authentication</title>
4534
4535       <para>AFS distinguishes between authentication and authorization
4536       checking. Authentication refers to the process of proving
4537       identity. Authorization checking refers to the process of verifying
4538       that an authenticated identity is allowed to perform a certain
4539       action.</para>
4540
4541       <para>AFS implements authentication at the level of
4542       connections. Each time two parties establish a new connection, they
4543       mutually authenticate. In general, each issue of an AFS command
4544       establishes a new connection between AFS server process and
4545       client.</para>
4546
4547       <para>AFS implements authorization checking at the level of server
4548       machines. If authorization checking is enabled on a server machine,
4549       then all of the server processes running on it provide services only
4550       to authorized users. If authorization checking is disabled on a
4551       server machine, then all of the server processes perform any action
4552       for anyone. Obviously, disabling authorization checking is an
4553       extreme security exposure. For more information, see <link
4554       linkend="HDRWQ123">Managing Authentication and Authorization
4555       Requirements</link>.</para>
4556     </sect2>
4557
4558     <sect2 id="HDRWQ74">
4559       <title>Improving Security in Your Cell</title>
4560
4561       <indexterm>
4562         <primary>security</primary>
4563
4564         <secondary>suggestions for improving</secondary>
4565       </indexterm>
4566
4567       <para>You can improve the level of security in your cell by
4568       configuring user accounts, server machines, and system administrator
4569       accounts in the indicated way.</para>
4570
4571       <formalpara>
4572         <title>User Accounts</title>
4573
4574         <para>
4575           <itemizedlist>
4576             <listitem>
4577               <para>Use an AFS-modified login utility, or include the
4578               <emphasis role="bold">-setpag</emphasis> flag to the
4579               <emphasis role="bold">klog</emphasis> command, to associate
4580               the credential structure that houses tokens with a PAG
4581               rather than a UNIX UID. This prevents users from inheriting
4582               someone else's tokens by assuming their UNIX identity. For
4583               further discussion, see <link linkend="HDRWQ64">Identifying
4584               AFS Tokens by PAG</link>.</para>
4585             </listitem>
4586
4587             <listitem>
4588               <para>Encourage users to issue the <emphasis
4589               role="bold">unlog</emphasis> command to destroy their tokens
4590               before logging out. This forestalls attempts to access
4591               tokens left behind kernel memory. Consider including the
4592               <emphasis role="bold">unlog</emphasis> command in every
4593               user's <emphasis role="bold">.logout</emphasis> file or
4594               equivalent.</para>
4595             </listitem>
4596           </itemizedlist>
4597         </para>
4598       </formalpara>
4599
4600       <formalpara>
4601         <title>Server Machines</title>
4602
4603         <para>
4604           <itemizedlist>
4605             <listitem>
4606               <para>Disable authorization checking only in emergencies or
4607               for very brief periods of time. It is best to work at the
4608               console of the affected machine during this time, to prevent
4609               anyone else from accessing the machine through the
4610               keyboard.</para>
4611             </listitem>
4612
4613             <listitem>
4614               <para>Change the AFS server encryption key on a frequent and
4615               regular schedule. Make it difficult to guess (a long string
4616               including nonalphabetic characters, for instance). Unlike
4617               user passwords, the password from which the AFS key is
4618               derived can be longer than eight characters, because it is
4619               never used during login. The <emphasis role="bold">kas
4620               setpassword</emphasis> command accepts a password hundreds
4621               of characters long. For instructions, see <link
4622               linkend="HDRWQ355">Managing Server Encryption
4623               Keys</link>.</para>
4624             </listitem>
4625
4626             <listitem>
4627               <para>As much as possible, limit the number of people who
4628               can login at a server machine's console or remotely.
4629               Imposing this limit is an extra security precaution rather
4630               than a necessity. The machine cannot serve as an AFS client
4631               in this case.</para>
4632             </listitem>
4633
4634             <listitem>
4635               <para>Particularly limit access to the local superuser
4636               <emphasis role="bold">root</emphasis> account on a server
4637               machine. The local superuser <emphasis
4638               role="bold">root</emphasis> has free access to important
4639               administrative subdirectories of the <emphasis
4640               role="bold">/usr/afs</emphasis> directory, as described in
4641               <link linkend="HDRWQ53">AFS Files on the Local
4642               Disk</link>.</para>
4643
4644               <indexterm>
4645                 <primary>root superuser</primary>
4646
4647                 <secondary>limiting logins</secondary>
4648               </indexterm>
4649             </listitem>
4650
4651             <listitem>
4652               <para>As in any computing environment, server machines must
4653               be located in a secured area. Any other security measures
4654               are effectively worthless if unauthorized people can access
4655               the computer hardware.</para>
4656             </listitem>
4657           </itemizedlist>
4658         </para>
4659       </formalpara>
4660
4661       <formalpara>
4662         <title>System Administrators</title>
4663
4664         <para>
4665           <itemizedlist>
4666             <listitem>
4667               <para>Limit the number of system administrators in your
4668               cell. Limit the use of system administrator accounts on
4669               publicly accessible workstations. Such machines are not
4670               secure, so unscrupulous users can install programs that try
4671               to steal tokens or passwords. If administrators must use
4672               publicly accessible workstations at times, they must issue
4673               the <emphasis role="bold">unlog</emphasis> command before
4674               leaving the machine.</para>
4675             </listitem>
4676
4677             <listitem>
4678               <para>Create an administrative account for each
4679               administrator separate from the personal account, and assign
4680               AFS privileges only to the administrative account. The
4681               administrators must authenticate to the administrative
4682               accounts to perform duties that require privilege, which
4683               provides a useful audit trail as well.</para>
4684             </listitem>
4685
4686             <listitem>
4687               <para>Administrators must not leave a machine unattended
4688               while they have valid tokens. Issue the <emphasis
4689               role="bold">unlog</emphasis> command before leaving.</para>
4690             </listitem>
4691
4692             <listitem>
4693               <para>Use the <emphasis role="bold">-lifetime</emphasis>
4694               argument to the <emphasis role="bold">kas
4695               setfields</emphasis> command to set the token lifetime for
4696               administrative accounts to a fairly short amount of time.
4697               The default lifetime for AFS tokens is 25 hours, but 30 or
4698               60 minutes is possibly a more reasonable lifetime for
4699               administrative tokens. The tokens for administrators who
4700               initiate AFS Backup System operations must last somewhat
4701               longer, because it can take several hours to complete some
4702               dump operations, depending on the speed of the tape device
4703               and the network connecting it to the file server machines
4704               that house the volumes is it accessing.</para>
4705             </listitem>
4706
4707             <listitem>
4708               <para>Limit administrators' use of the <emphasis
4709               role="bold">telnet</emphasis> program. It sends unencrypted
4710               passwords across the network. Similarly, limit use of other
4711               remote programs such as <emphasis role="bold">rsh</emphasis>
4712               and <emphasis role="bold">rcp</emphasis>, which send
4713               unencrypted tokens across the network.</para>
4714             </listitem>
4715           </itemizedlist>
4716         </para>
4717       </formalpara>
4718     </sect2>
4719
4720     <sect2 id="HDRWQ75">
4721       <title>A More Detailed Look at Mutual Authentication</title>
4722
4723       <indexterm>
4724         <primary>mutual authentication</primary>
4725       </indexterm>
4726
4727       <indexterm>
4728         <primary>distributed file system</primary>
4729
4730         <secondary>security issues</secondary>
4731       </indexterm>
4732
4733       <indexterm>
4734         <primary>shared secret</primary>
4735       </indexterm>
4736
4737       <indexterm>
4738         <primary>server encryption key</primary>
4739
4740         <secondary>defined</secondary>
4741       </indexterm>
4742
4743       <para>As in any file system, security is a prime concern in AFS. A
4744       file system that makes file sharing easy is not useful if it makes
4745       file sharing mandatory, so AFS incorporates several features that
4746       prevent unauthorized users from accessing data.  Security in a
4747       networked environment is difficult because almost all procedures
4748       require transmission of information across wires that almost anyone
4749       can tap into. Also, many machines on networks are powerful enough
4750       that unscrupulous users can monitor transactions or even intercept
4751       transmissions and fake the identity of one of the
4752       participants.</para>
4753
4754       <para>The most effective precaution against eavesdropping and
4755       information theft or fakery is for servers and clients to accept the
4756       claimed identity of the other party only with sufficient proof. In
4757       other words, the nature of the network forces all parties on the
4758       network to assume that the other party in a transaction is not
4759       genuine until proven so. Mutual authentication is the means through
4760       which parties prove their genuineness.</para>
4761
4762       <para>Because the measures needed to prevent fakery must be quite
4763       sophisticated, the implementation of mutual authentication
4764       procedures is complex. The underlying concept is simple, however:
4765       parties prove their identities by demonstrating knowledge of a
4766       shared secret. A shared secret is a piece of information known only
4767       to the parties who are mutually authenticating (they can sometimes
4768       learn it in the first place from a trusted third party or some other
4769       source). The party who originates the transaction presents the
4770       shared secret and refuses to accept the other party as valid until
4771       it shows that it knows the secret too.</para>
4772
4773       <para>The most common form of shared secret in AFS transactions is
4774       the encryption key, also referred to simply as a key. The two
4775       parties use their shared key to encrypt the packets of information
4776       they send and to decrypt the ones they receive.  Encryption using
4777       keys actually serves two related purposes. First, it protects
4778       messages as they cross the network, preventing anyone who does not
4779       know the key from eavesdropping. Second, ability to encrypt and
4780       decrypt messages successfully indicates that the parties are using
4781       the key (it is their shared secret). If they are using different
4782       keys, messages remain scrambled and unintelligible after
4783       decryption.</para>
4784
4785       <para>The following sections describe AFS's mutual authentication
4786       procedures in more detail. Feel free to skip these sections if you
4787       are not interested in the mutual authentication process.</para>
4788
4789       <sect3 id="Header_92">
4790         <title>Simple Mutual Authentication</title>
4791
4792         <para>Simple mutual authentication involves only one encryption
4793         key and two parties, generally a client and server. The client
4794         contacts the server by sending a challenge message encrypted with
4795         a key known only to the two of them. The server decrypts the
4796         message using its key, which is the same as the client's if they
4797         really do share the same secret. The server responds to the
4798         challenge and uses its key to encrypt its response. The client
4799         uses its key to decrypt the server's response, and if it is
4800         correct, then the client can be sure that the server is genuine:
4801         only someone who knows the same key as the client can decrypt the
4802         challenge and answer it correctly. On its side, the server
4803         concludes that the client is genuine because the challenge message
4804         made sense when the server decrypted it.</para>
4805
4806         <para>AFS uses simple mutual authentication to verify user
4807         identities during the first part of the login procedure. In that
4808         case, the key is based on the user's password.</para>
4809       </sect3>
4810
4811       <sect3 id="HDRWQ76">
4812         <title>Complex Mutual Authentication</title>
4813
4814         <para>Complex mutual authentication involves three encryption keys
4815         and three parties. All secure AFS transactions (except the first
4816         part of the login process) employ complex mutual
4817         authentication.</para>
4818
4819         <indexterm>
4820           <primary>ticket-granter</primary>
4821         </indexterm>
4822
4823         <indexterm>
4824           <primary>server encryption key</primary>
4825         </indexterm>
4826
4827         <indexterm>
4828           <primary>tokens</primary>
4829
4830           <secondary>data in</secondary>
4831         </indexterm>
4832
4833         <para>When a client wishes to communicate with a server, it first
4834         contacts a third party called a ticket-granter. The ticket-granter
4835         and the client mutually authenticate using the simple
4836         procedure. When they finish, the ticket-granter gives the client a
4837         server ticket (or simply ticket) as proof that it (the
4838         ticket-granter) has preverified the identity of the client. The
4839         ticket-granter encrypts the ticket with the first of the three
4840         keys, called the server encryption key because it is known only to
4841         the ticket-granter and the server the client wants to contact. The
4842         client does not know this key.</para>
4843
4844         <para>The ticket-granter sends several other pieces of information
4845         along with the ticket. They enable the client to use the ticket
4846         effectively despite being unable to decrypt the ticket
4847         itself. Along with the ticket, the items constitute a token:
4848         <itemizedlist>
4849             <listitem>
4850               <para>A session key, which is the second encryption key
4851               involved in mutual authentication. The ticket-granter
4852               invents the session key at random as the shared secret
4853               between client and server. For reasons explained further
4854               below, the ticket-granter also puts a copy of the session
4855               key inside the ticket. The client and server use the session
4856               key to encrypt messages they send to one another during
4857               their transactions. The ticket-granter invents a different
4858               session key for each connection between a client and a
4859               server (there can be several transactions during a single
4860               connection).</para>
4861
4862               <indexterm>
4863                 <primary>session key</primary>
4864               </indexterm>
4865             </listitem>
4866
4867             <listitem>
4868               <para>The name of the server for which the ticket is valid
4869               (and so which server encryption key encrypts the ticket
4870               itself).</para>
4871             </listitem>
4872
4873             <listitem>
4874               <para>A ticket lifetime indicator. The default lifetime of
4875               AFS server tickets is 100 hours. If the client wants to
4876               contact the server again after the ticket expires, it must
4877               contact the ticket-granter to get a new ticket.</para>
4878             </listitem>
4879         </itemizedlist>
4880         </para>
4881
4882         <para>The ticket-granter seals the entire token with the third key
4883         involved in complex mutual authentication--the key known only to
4884         it (the ticket-granter) and the client. In some cases, this third
4885         key is derived from the password of the human user whom the client
4886         represents.</para>
4887
4888         <para>Now that the client has a valid server ticket, it is ready
4889         to contact the server. It sends the server two things:
4890         <itemizedlist>
4891             <listitem>
4892               <para>The server ticket. This is encrypted with the server
4893               encryption key.</para>
4894             </listitem>
4895
4896             <listitem>
4897               <para>Its request message, encrypted with the session
4898               key. Encrypting the message protects it as it crosses the
4899               network, since only the server/client pair for whom the
4900               ticket-granter invented the session key know it.</para>
4901             </listitem>
4902         </itemizedlist>
4903         </para>
4904
4905         <para>At this point, the server does not know the session key,
4906         because the ticket-granter just created it. However, the
4907         ticket-granter put a copy of the session key inside the
4908         ticket. The server uses the server encryption key to decrypts the
4909         ticket and learns the session key. It then uses the session key to
4910         decrypt the client's request message. It generates a response and
4911         sends it to the client. It encrypts the response with the session
4912         key to protect it as it crosses the network.</para>
4913
4914         <para>This step is the heart of mutual authentication between
4915         client and server, because it proves to both parties that they
4916         know the same secret:
4917         <itemizedlist>
4918             <listitem>
4919               <para>The server concludes that the client is authorized to
4920               make a request because the request message makes sense when
4921               the server decrypts it using the session key. If the client
4922               uses a different session key than the one the server finds
4923               inside the ticket, then the request message remains
4924               unintelligible even after decryption. The two copies of the
4925               session key (the one inside the ticket and the one the
4926               client used) can only be the same if they both came from the
4927               ticket-granter. The client cannot fake knowledge of the
4928               session key because it cannot look inside the ticket, sealed
4929               as it is with the server encryption key known only to the
4930               server and the ticket-granter. The server trusts the
4931               ticket-granter to give tokens only to clients with whom it
4932               (the ticket-granter) has authenticated, so the server
4933               decides the client is legitimate.</para>
4934
4935               <para>(Note that there is no direct communication between
4936               the ticket-granter and the server, even though their
4937               relationship is central to ticket-based mutual
4938               authentication. They interact only indirectly, via the
4939               client's possession of a ticket sealed with their shared
4940               secret.)</para>
4941             </listitem>
4942
4943             <listitem>
4944               <para>The client concludes that the server is genuine and
4945               trusts the response it gets back from the server, because
4946               the response makes sense after the client decrypts it using
4947               the session key. This indicates that the server encrypted
4948               the response with the same session key as the client
4949               knows. The only way for the server to learn that matching
4950               session key is to decrypt the ticket first. The server can
4951               only decrypt the ticket because it shares the secret of the
4952               server encryption key with the ticket-granter. The client
4953               trusts the ticket-granter to give out tickets only for
4954               legitimate servers, so the client accepts a server that can
4955               decrypt the ticket as genuine, and accepts its
4956               response.</para>
4957             </listitem>
4958         </itemizedlist>
4959         </para>
4960       </sect3>
4961     </sect2>
4962   </sect1>
4963
4964   <sect1 id="HDRWQ77">
4965     <title>Backing Up AFS Data</title>
4966
4967     <para>AFS provides two related facilities that help the administrator
4968     back up AFS data: backup volumes and the AFS Backup System.</para>
4969
4970     <sect2 id="Header_95">
4971       <title>Backup Volumes</title>
4972
4973       <para>The first facility is the backup volume, which you create by
4974       cloning a read/write volume. The backup volume is read-only and so
4975       preserves the state of the read/write volume at the time the clone
4976       is made.</para>
4977
4978       <para>Backup volumes can ease administration if you mount them in
4979       the file system and make their contents available to users.  For
4980       example, it often makes sense to mount the backup version of each
4981       user volume as a subdirectory of the user's home directory. A
4982       conventional name for this mount point is <emphasis
4983       role="bold">OldFiles</emphasis>. Create a new version of the backup
4984       volume (that is, reclone the read/write) once a day to capture any
4985       changes that were made since the previous backup. If a user
4986       accidentally removes or changes data, the user can restore it from
4987       the backup volume, rather than having to ask you to restore
4988       it.</para>
4989
4990       <para>The OpenAFS User Guide does not mention backup volumes, so
4991       regular users do not know about them if you decide not to use
4992       them. This implies that if you <emphasis role="bold">do</emphasis>
4993       make backup versions of user volumes, you need to tell your users
4994       about how the backup works and where you have mounted it.</para>
4995
4996       <para>Users are often concerned that the data in a backup volume
4997       counts against their volume quota and some of them even want to
4998       remove the <emphasis role="bold">OldFiles</emphasis> mount point. It
4999       does not, because the backup volume is a separate volume. The only
5000       amount of space it uses in the user's volume is the amount needed
5001       for the mount point, which is about the same as the amount needed
5002       for a standard directory element.</para>
5003
5004       <para>Backup volumes are discussed in detail in <link
5005       linkend="HDRWQ201">Creating Backup Volumes</link>.</para>
5006     </sect2>
5007
5008     <sect2 id="Header_96">
5009       <title>The AFS Backup System</title>
5010
5011       <para>Backup volumes can reduce restoration requests, but they
5012       reside on disk and so do not protect data from loss due to hardware
5013       failure. Like any file system, AFS is vulnerable to this sort of
5014       data loss.</para>
5015
5016       <para>To protect your cell's users from permanent loss of data, you
5017       are strongly urged to back up your file system to tape on a regular
5018       and frequent schedule. The AFS Backup System is available to ease
5019       the administration and performance of backups. For detailed
5020       information about the AFS Backup System, see <link
5021       linkend="HDRWQ248">Configuring the AFS Backup System</link> and
5022       <link linkend="HDRWQ283">Backing Up and Restoring AFS
5023       Data</link>.</para>
5024     </sect2>
5025   </sect1>
5026
5027   <sect1 id="HDRWQ79">
5028     <title>Accessing AFS through NFS</title>
5029
5030     <para>Users of NFS client machines can access the AFS filespace by
5031     mounting the <emphasis role="bold">/afs</emphasis> directory of an AFS
5032     client machine that is running the NFS/AFS Translator. This is a
5033     particular advantage in cells already running NFS who want to access
5034     AFS using client machines for which AFS is not available. See <link
5035     linkend="HDRWQ595">Appendix A, Managing the NFS/AFS
5036     Translator</link>.</para>
5037   </sect1>
5038 </chapter>