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