1 <?xml version="1.0" encoding="UTF-8"?>
2 <chapter id="HDRWQ449">
3 <title>Creating and Deleting User Accounts with the uss Command Suite</title>
6 <primary>user account</primary>
8 <secondary>two methods for creating and deleting</secondary>
11 <para>The <emphasis role="bold">uss</emphasis> command suite helps you create and delete AFS user accounts quickly and easily. You
12 can create a single account with the <emphasis role="bold">uss add</emphasis> command, delete a single account with the <emphasis
13 role="bold">uss delete</emphasis> command, or create and delete multiple accounts with the <emphasis role="bold">uss
14 bulk</emphasis> command.</para>
16 <para>A single <emphasis role="bold">uss add</emphasis> or <emphasis role="bold">uss bulk</emphasis> command can create a complete
17 AFS user account because the <emphasis role="bold">uss</emphasis> command interpreter refers to a template file in which you
18 predefine the configuration of many account components. The <emphasis role="bold">uss delete</emphasis> command deletes most of
19 the components of a user account, but does not use a template file.</para>
21 <para>The <emphasis role="bold">uss</emphasis> suite also easily incorporates shell scripts or other programs that you write to
22 perform parts of account creation and deletion unique to your site. To invoke a script or program automatically as a <emphasis
23 role="bold">uss</emphasis> command runs, use the appropriate instructions in the template file or bulk input file. Various
24 sections of this chapter discuss possible uses for scripts.</para>
26 <para>Using the <emphasis role="bold">uss</emphasis> commands to create and delete accounts is the recommended method because it
27 automates and correctly orders most of the necessary steps. The alternative is to issue a series of separate commands to the
28 various AFS servers, which requires more careful record keeping. For instructions, see <link linkend="HDRWQ491">Administering User
29 Accounts</link>.</para>
32 <title>Summary of Instructions</title>
34 <para>This chapter explains how to perform the following tasks by using the indicated commands:</para>
36 <informaltable frame="none">
38 <colspec colwidth="80*" />
40 <colspec colwidth="20*" />
44 <entry>Add a single user account</entry>
46 <entry><emphasis role="bold">uss add</emphasis></entry>
50 <entry>Delete a single user account</entry>
52 <entry><emphasis role="bold">uss delete</emphasis></entry>
56 <entry>Add and delete multiple accounts</entry>
58 <entry><emphasis role="bold">uss bulk</emphasis></entry>
66 <title>Overview of the uss Command Suite</title>
68 <para>The commands in the <emphasis role="bold">uss</emphasis> suite help you to automate the creation and deletion of AFS user
69 accounts: <itemizedlist>
71 <para>The <emphasis role="bold">uss add</emphasis> command creates all of the components of an account, one account at a
72 time. It consults a template file that defines account configuration.</para>
76 <para>The <emphasis role="bold">uss delete</emphasis> command deletes the major components of an account, one account at a
77 time. It does not use a template file, so you possibly need to perform additional tasks manually.</para>
81 <para>The <emphasis role="bold">uss bulk</emphasis> command can create and delete multiple accounts. It refers to a bulk
82 input file that can contain any number of account-creation and deletion instructions, along with other instructions for
83 further automating the process.</para>
85 </itemizedlist></para>
88 <primary>user account</primary>
90 <secondary>components</secondary>
94 <primary>user</primary>
96 <secondary>account</secondary>
98 <see>user account</see>
101 <sect2 id="Header_538">
102 <title>The Components of an AFS User Account</title>
104 <para>An AFS user account can have many components. The only two required components are entries in the Protection Database
105 and Authentication Database, but the other components add functionality and usability. The following information also appears
106 in a corresponding section of <link linkend="HDRWQ491">Administering User Accounts</link>, but is repeated here for your
107 convenience. <itemizedlist>
109 <para>A <emphasis>Protection Database entry</emphasis> defines the username (the name provided when authenticating with
110 AFS), and maps it to an AFS user ID (AFS UID), a number that the AFS servers use internally when referencing users. The
111 Protection Database also tracks the groups to which the user belongs. For details, see <link
112 linkend="HDRWQ531">Administering the Protection Database</link>.</para>
116 <para>An <emphasis>Authentication Database entry</emphasis> records the user's AFS password in a scrambled form suitable
117 for use as an encryption key.</para>
121 <para>A home <emphasis>volume</emphasis> stores all the files in the user's home directory together on a single
122 partition of a file server machine. The volume has an associated quota that limits its size. For a complete discussion
123 of volumes, see <link linkend="HDRWQ174">Managing Volumes</link>.</para>
127 <para>A <emphasis>mount point</emphasis> makes the contents of the user's volume visible and accessible in the AFS
128 filespace, and acts as the user's home directory. For more details about mount points, see <link
129 linkend="HDRWQ183">About Mounting Volumes</link>.</para>
133 <para>Full access permissions on the home directory's <emphasis>access control list (ACL)</emphasis> and ownership of
134 the directory (as displayed by the UNIX <emphasis role="bold">ls -ld</emphasis> command) enable the user to manage his
135 or her files. For details on AFS file protection, see <link linkend="HDRWQ562">Managing Access Control
140 <para>A <emphasis>local password file entry</emphasis> (in the <emphasis role="bold">/etc/passwd</emphasis> file or
141 equivalent) of each AFS client machine enables the user to log in and access AFS files through the Cache Manager. A
142 subsequent section in this chapter further discusses local password file entries.</para>
146 <para>Other optional <emphasis>configuration files</emphasis> make the account more convenient to use. Such files help
147 the user log in and log out more easily, receive electronic mail, print, and so on.</para>
149 </itemizedlist></para>
152 <primary>uss commands</primary>
154 <secondary>privilege required</secondary>
158 <primary>privilege</primary>
160 <secondary>required for uss commands</secondary>
164 <sect2 id="HDRWQ453">
165 <title>Privilege Requirements for the uss Commands</title>
167 <para>To issue <emphasis role="bold">uss</emphasis> commands successfully, you usually need all of the standard AFS
168 administrative privileges: membership in the <emphasis role="bold">system:administrators</emphasis> group, inclusion in the
169 <emphasis role="bold">/usr/afs/etc/UserList</emphasis> file on every relevant server machine, and the
170 <computeroutput>ADMIN</computeroutput> flag on your Authentication Database entry. For details on administrative privilege,
171 see <link linkend="HDRWQ581">Managing Administrative Privilege</link>. <indexterm>
172 <primary>uss commands</primary>
174 <secondary>add</secondary>
176 <tertiary>avoiding interruption</tertiary>
177 </indexterm> <indexterm>
178 <primary>uss commands</primary>
180 <secondary>delete</secondary>
182 <tertiary>avoiding interruption</tertiary>
183 </indexterm> <indexterm>
184 <primary>previewing</primary>
186 <secondary>user account creation/deletion with uss</secondary>
187 </indexterm> <indexterm>
188 <primary>user account</primary>
190 <secondary>uss commands to create/delete</secondary>
192 <tertiary>previewing</tertiary>
193 </indexterm> <indexterm>
194 <primary>user account</primary>
196 <secondary>creation using uss</secondary>
198 <tertiary>previewing</tertiary>
199 </indexterm> <indexterm>
200 <primary>user account</primary>
202 <secondary>deletion using uss</secondary>
204 <tertiary>previewing</tertiary>
205 </indexterm> <indexterm>
206 <primary>uss</primary>
208 <secondary>previewing effect of command</secondary>
212 <sect2 id="HDRWQ454">
213 <title>Avoiding and Recovering from Errors and Interrupted Operations</title>
215 <para>As for any complex operation, there are a number of possible reasons that an account-creation or deletion operation can
216 halt before it completes. You can easily avoid several of the common reasons by making the following checks before issuing a
217 <emphasis role="bold">uss</emphasis> command: <itemizedlist>
219 <para>Verify that you have all of the administrative privileges you need to complete an operation, as described in <link
220 linkend="HDRWQ453">Privilege Requirements for the uss Commands</link>. The instructions for using the <emphasis
221 role="bold">uss add</emphasis>, <emphasis role="bold">uss delete</emphasis>, and <emphasis role="bold">uss
222 bulk</emphasis> commands include this check as a step.</para>
226 <para>Proofread the template and bulk input files for correct syntax and acceptable values. For discussion, see <link
227 linkend="HDRWQ463">Constructing a uss Template File</link> and <link linkend="HDRWQ489">Constructing a Bulk Input
232 <para>Do not issue <emphasis role="bold">uss</emphasis> commands when you are aware of network, server machine, or
233 server process outages. Because <emphasis role="bold">uss</emphasis> operations affect so many components of AFS, it is
234 unlikely that the command can succeed when there are outages.</para>
236 </itemizedlist></para>
238 <para>Another way to avoid errors that halt an operation is to preview the <emphasis role="bold">uss</emphasis> command by
239 combining the <emphasis role="bold">-dryrun</emphasis> flag with the other arguments to be used on the actual command. The
240 <emphasis role="bold">uss</emphasis> command interpreter generates a screen trace of the actions to be performed by the actual
241 command, without performing them.</para>
243 <para>Using the <emphasis role="bold">-dryrun</emphasis> flag reveals many basic errors that can halt an operation,
244 particularly the ones due to incorrect syntax in the command line, template file, or bulk input file. It does not catch all
245 possible errors, however, because the command interpreter is not actually attempting to perform the actions it is tracing. For
246 example, a Volume Server outage does not necessarily halt the volume creation step when the <emphasis
247 role="bold">-dryrun</emphasis> flag is included, because the command interpreter is not actually contacting the server; such
248 an outage halts the actual creation operation. <indexterm>
249 <primary>failure</primary>
251 <secondary>of uss account creation</secondary>
253 <tertiary>recovering from</tertiary>
254 </indexterm> <indexterm>
255 <primary>uss</primary>
257 <secondary>account</secondary>
259 <tertiary>recovering from account creation failure</tertiary>
260 </indexterm> <indexterm>
261 <primary>uss</primary>
263 <secondary>command</secondary>
265 <tertiary>reissuing, effect of</tertiary>
268 <para>When the <emphasis role="bold">uss</emphasis> command interpreter encounters error conditions minor enough that they do
269 not require halting the operation, it usually generates a message that begins with the string <computeroutput>uss:
270 Warning:</computeroutput> and describes the action it is taking to avoid halting. For example, if a user's Protection Database
271 entry already exists, the following message appears on the standard output stream:</para>
274 uss: Warning: User 'user' already in the protection database
275 The uid for user 'user' is AFS UID
278 <para>If an error is more serious, the word <computeroutput>Warning</computeroutput> does not appear in the message, which
279 instead describes why the command interpreter cannot perform the requested action. Not all of these errors cause the <emphasis
280 role="bold">uss</emphasis> operation to halt, but they still require you to take corrective action. For example, attempting to
281 create a mount point fails if you lack the necessary permissions on the parent directory's ACL, or if the mount point pathname
282 in the <emphasis role="bold">V</emphasis> instruction's mount_point field is malformed. However, this error does not cause the
283 creation operation to halt until later instructions in the template attempt to install subdirectories or files under the
284 nonexistent mount point.</para>
286 <para>If the command shell prompts returns directly after an error message, then the error generally was serious enough to
287 halt the operation. When an error halts account creation or deletion, the best way to recover is to find and fix the cause,
288 and then reissue the same <emphasis role="bold">uss</emphasis> command. <indexterm>
289 <primary>uss commands</primary>
291 <secondary>overwriting existing account components</secondary>
292 </indexterm> <indexterm>
293 <primary>overwriting</primary>
295 <secondary>existing directories/files/links with uss</secondary>
296 </indexterm> <indexterm>
297 <primary>directory</primary>
299 <secondary>overwritten by uss if exists</secondary>
300 </indexterm> <indexterm>
301 <primary>file</primary>
303 <secondary>overwritten by uss if exists</secondary>
304 </indexterm> <indexterm>
305 <primary>hard link</primary>
307 <secondary>overwritten by uss if exists</secondary>
308 </indexterm> <indexterm>
309 <primary>symbolic link</primary>
311 <secondary>overwritten by uss if exists</secondary>
314 <para>The following list describes what happens when components of a user's account already exist when you reissue an
315 account-creation command (the <emphasis role="bold">uss add</emphasis> command, or the <emphasis role="bold">uss
316 bulk</emphasis> command when the bulk input file contains <emphasis role="bold">add</emphasis> instructions): <itemizedlist>
318 <para>If the Protection Database entry already exists, a message confirms its existence and specifies the associated AFS
323 <para>If the Authentication Database entry already exists, a message confirms its existence.</para>
327 <para>If the volume and associated Volume Location Database (VLDB) entry already exist, a message confirms their
328 existence. However, the <emphasis role="bold">uss</emphasis> command interpreter does alter the volume's quota, mount
329 point, or ACL if any of the relevant fields in the template <emphasis role="bold">V</emphasis> instruction have changed
330 since the command last ran. If the value in the mount_point field has changed, the command interpreter creates the new
331 mount point but does not remove any existing mount points.</para>
335 <para>If any of the fields in the template <emphasis role="bold">A</emphasis> instruction have changed, the <emphasis
336 role="bold">uss</emphasis> command interpreter makes the changes without comment.</para>
340 <para>If a directory, file, or link defined by a template file <emphasis role="bold">D</emphasis>, <emphasis
341 role="bold">E</emphasis>, <emphasis role="bold">F</emphasis>, <emphasis role="bold">L</emphasis>, or <emphasis
342 role="bold">S</emphasis> instruction already exists, the <emphasis role="bold">uss</emphasis> command interpreter
343 replaces the existing element with one that conforms to the template definition. To control whether the <emphasis
344 role="bold">uss</emphasis> command interpreter prompts for confirmation that you wish to overwrite a given element, use
345 the <emphasis role="bold">-overwrite</emphasis> flag to the <emphasis role="bold">uss add</emphasis> or <emphasis
346 role="bold">uss bulk</emphasis> command: <itemizedlist>
348 <para>If you include the <emphasis role="bold">-overwrite</emphasis> flag, the command interpreter automatically
349 overwrites all elements without asking for confirmation.</para>
353 <para>If you omit the flag, the command interpreter prompts once for each account to ask if you want to overwrite
354 all elements associated with it.</para>
356 </itemizedlist></para>
360 <para>The command interpreter always reexecutes <emphasis role="bold">X</emphasis> instructions in the template file. If
361 a command's result already holds, reissuing it has the same effect as reissuing it outside the context of the <emphasis
362 role="bold">uss</emphasis> commands.</para>
364 </itemizedlist></para>
366 <para>The following describes what happens when a <emphasis role="bold">uss delete</emphasis> command references account
367 components that have already been deleted. <itemizedlist>
369 <para>If the volume and VLDB entry no longer exist, a message confirms their absence.</para>
373 <para>If the Authentication Database entry no longer exists, a message confirms its absence.</para>
375 </itemizedlist></para>
378 <primary>local password file</primary>
380 <secondary>creating entry for AFS user</secondary>
382 <tertiary>with uss</tertiary>
387 <sect1 id="HDRWQ455">
388 <title>Creating Local Password File Entries with uss</title>
390 <para>To obtain authenticated access to a cell's AFS filespace, a user must not only have a valid AFS token, but also an entry
391 in the local password file (<emphasis role="bold">/etc/passwd</emphasis> or equivalent) of the AFS client machine. This section
392 discusses why it is important for the user's AFS UID to match to the UNIX UID listed in the local password file, the appropriate
393 value to put in the file's password field, and outlines a method for creating a single source password file.</para>
395 <para>For instructions on using the template file's <emphasis role="bold">E</emphasis> instruction to generate local password
396 file entries automatically as part of account creation, see <link linkend="HDRWQ458">Creating a Common Source Password
399 <para>The following information also appears in a corresponding section of <link linkend="HDRWQ491">Administering User
400 Accounts</link>, but is repeated here for your convenience. <indexterm>
401 <primary>AFS UID</primary>
403 <secondary>matching with UNIX UID</secondary>
404 </indexterm> <indexterm>
405 <primary>user account</primary>
407 <secondary>matching AFS and UNIX UIDs</secondary>
408 </indexterm> <indexterm>
409 <primary>uss</primary>
411 <secondary>AFS UID, assigning</secondary>
412 </indexterm> <indexterm>
413 <primary>assigning</primary>
415 <secondary>AFS UID with uss</secondary>
416 </indexterm> <indexterm>
417 <primary>UNIX UID</primary>
419 <secondary>matching with AFS UID</secondary>
422 <sect2 id="HDRWQ456">
423 <title>Assigning AFS and UNIX UIDs that Match</title>
425 <para>A user account is easiest to administer and use if the AFS user ID number (AFS UID) and UNIX UID match. All instructions
426 in the AFS documentation assume that they do.</para>
428 <para>The most basic reason to make AFS and UNIX UIDs the same is so that the owner name reported by the UNIX <emphasis
429 role="bold">ls -l</emphasis> and <emphasis role="bold">ls -ld</emphasis> commands makes sense for AFS files and directories.
430 Following standard UNIX practice, the File Server records a number rather than a username in an AFS file or directory's owner
431 field: the owner's AFS UID. When you issue the <emphasis role="bold">ls -l</emphasis> command, it translates the UID to a
432 username according to the mapping in the local password file, not the AFS Protection Database. If the AFS and UNIX UIDs do not
433 match, the <emphasis role="bold">ls -l</emphasis> command reports an unexpected (and incorrect) owner. The output can even
434 vary on different client machines if their local password files map the same UNIX UID to different names.</para>
436 <para>Follow the recommendations in the indicated sections to make AFS and UNIX UIDs match when you are creating accounts for
437 various types of users: <itemizedlist>
439 <para>If creating an AFS account for a user who already has a UNIX UID, see <link linkend="HDRWQ459">Converting Existing
440 UNIX Accounts with uss</link>.</para>
444 <para>If some users in your cell have existing UNIX accounts but the user for whom you are creating an AFS account does
445 not, then it is best to allow the Protection Server to allocate an AFS UID automatically. To avoid overlap of AFS UIDs
446 with existing UNIX UIDs, set the Protection Database's <computeroutput>max user id</computeroutput> counter higher than
447 the largest UNIX UID, using the instructions in <link linkend="HDRWQ560">Displaying and Setting the AFS UID and GID
448 Counters</link>.</para>
452 <para>If none of your users have existing UNIX accounts, allow the Protection Server to allocate AFS UIDs automatically,
453 starting either at its default or at the value you have set for the <computeroutput>max user id</computeroutput>
456 </itemizedlist></para>
459 <primary>password</primary>
461 <secondary>setting in local password file</secondary>
463 <tertiary>with uss</tertiary>
467 <primary>local password file</primary>
469 <secondary>setting password in</secondary>
471 <tertiary>with uss</tertiary>
475 <sect2 id="HDRWQ457">
476 <title>Specifying Passwords in the Local Password File</title>
478 <para>Authenticating with AFS is easiest for your users if you install and configure an AFS-modified login utility, which logs
479 a user into the local file system and obtains an AFS token in one step. In this case, the local password file no longer
480 controls a user's ability to login in most circumstances, because the AFS-modified login utility does not consult the local
481 password file if the user provides the correct AFS password. You can nonetheless use a password file entry's password field
482 (usually, the second field) in the following ways to control login and authentication: <itemizedlist>
484 <para>To prevent both local login and AFS authentication, place an asterisk ( * ) in the field. This is useful mainly in
485 emergencies, when you want to prevent a certain user from logging into the machine.</para>
489 <para>To prevent login to the local file system if the user does not provide the correct AFS password, place a character
490 string of any length other than the standard thirteen characters in the field. This is appropriate if you want to allow
491 only people with local AFS accounts to log into to your machines. A single <emphasis role="bold">X</emphasis> or other
492 character is the most easily recognizable way to do this.</para>
496 <para>To enable a user to log into the local file system even after providing an incorrect AFS password, record a
497 standard UNIX encrypted password in the field by issuing the standard UNIX password-setting command (<emphasis
498 role="bold">passwd</emphasis> or equivalent).</para>
500 </itemizedlist></para>
502 <para>If you do not use an AFS-modified login utility, you must place a standard UNIX password in the local password file of
503 every client machine the user will use. The user logs into the local file system only, and then must issue the <emphasis
504 role="bold">klog</emphasis> command to authenticate with AFS. It is simplest if the passwords in the local password file and
505 the Authentication Database are the same, but this is not required. <indexterm>
506 <primary>creating</primary>
508 <secondary>common local password file with uss</secondary>
509 </indexterm> <indexterm>
510 <primary>local password file</primary>
512 <secondary>creating common source version with uss</secondary>
513 </indexterm> <indexterm>
514 <primary>uss commands</primary>
516 <secondary>local password file</secondary>
518 <tertiary>creating common source version</tertiary>
519 </indexterm> <indexterm>
520 <primary>passwd file</primary>
522 <secondary></secondary>
524 <see>local password file</see>
528 <sect2 id="HDRWQ458">
529 <title>Creating a Common Source Password File</title>
531 <para>This section explains how to create a common source version of the local password file when using <emphasis
532 role="bold">uss</emphasis> commands to create user accounts. The sequence of steps is as follows: <orderedlist>
534 <para>Include an <emphasis role="bold">E</emphasis> instruction in the template file to create a one-line file that has
535 the format of a local password file entry.</para>
539 <para>Incorporate the one-line file into the common source version of the local password file. It makes sense to store
540 this file in AFS. See the following two example scripts for automating this step.</para>
542 </orderedlist></para>
544 <para>As an example, the template file used by the Example Corporation includes the following <emphasis role="bold">E</emphasis>
545 instruction to create a file called <emphasis role="bold">passwd_</emphasis>username in the directory <emphasis
546 role="bold">/afs/.example.com/common/etc/newaccts</emphasis> (the entire contents of the template file appear in <link
547 linkend="HDRWQ471">Example uss Templates</link> and a full description of the <emphasis role="bold">E</emphasis> instruction
548 appears in <link linkend="HDRWQ476">Creating One-Line Files with the E Instruction</link>):</para>
551 E /afs/.example.com/common/etc/newaccts/passwd_$USER 0644 root \
552 "$USER:X:$UID:11:$NAME:$MTPT:/bin/csh"
555 <para>For the user Joe L. Smith with username <emphasis role="bold">smith</emphasis>, this instruction creates a file called
556 <emphasis role="bold">passwd_smith</emphasis> which contains the following line:</para>
559 smith:X:1205:11:Joe L. Smith:/afs/example.com/usr/usr1/smith:/bin/csh
562 <para>A shell script is probably the easiest way to incorporate a set of files created in this manner into a common source
563 password file, and two sample shell scripts appear here. To automate the process even further, you can create a <emphasis
564 role="bold">cron</emphasis> process in a file server machine's <emphasis role="bold">/usr/afs/local/BosConfig</emphasis>
565 directory to execute the shell script, perhaps each day at a given time; for details, see <link linkend="HDRWQ162">To create
566 and start a new process</link>.</para>
569 <para>The following example scripts are suggestions only. If you choose to use them, or to model similar scripts on them,
570 you must test that your script has the desired result, preferably in a test environment.</para>
573 <para><emphasis role="bold">Example C Shell Script</emphasis></para>
575 <para>The first example is a simple C shell script suitable for the Example Corporation cell. It incorporates the individual files
576 found in the <emphasis role="bold">/afs/.example.com/common/uss/newaccts</emphasis> directory into a new version of the global
577 password file found in the <emphasis role="bold">/afs/.example.com/common/etc</emphasis> directory, sorting the files into
578 alphabetical order. It takes care to save the current version with a <emphasis role="bold">.old</emphasis> extension, then
579 removes the individual files when done.</para>
582 set dir = /afs/.example.com/common
583 cat $dir/uss/newaccts/passwd_* $dir/etc/passwd >! $dir/etc/passwd.new
584 mv $dir/etc/passwd $dir/etc/passwd.old
585 sort $dir/etc/passwd.new > $dir/etc/passwd
586 rm $dir/etc/passwd.new $dir/uss/newaccts/passwd_*
589 <para><emphasis role="bold">Example Bourne Shell Script</emphasis></para>
591 <para>The second, more elaborate, example is a Bourne shell script that first verifies that there are new <emphasis
592 role="bold">passwd_</emphasis>username files to be incorporated into the global password file. While running, it checks that
593 each new entry does not already exist. Like the shorter C shell example, it incorporates the individual files found in the
594 <emphasis role="bold">/afs/.example.com/common/uss/newaccts</emphasis> directory into a new version of the global <emphasis
595 role="bold">passwd</emphasis> file found in the <emphasis role="bold">/afs/.example.com/common/etc</emphasis> directory.</para>
599 DESTDIR=/afs/.example.com/common/uss/newaccts
601 DEST=/afs/.example.com/common/etc
602 cp /afs/.example.com/common/etc/passwd /afs/.example.com/common/uss/newaccts/passwd
603 echo "copied in passwd file."
604 PASSWD=/afs/.example.com/common/uss/newaccts/passwd
605 ENTRIES=`ls passwd_*`
608 echo No new entry found to be added to passwd file
611 echo "Adding new users to passwd file."
614 cat $i | awk -F: '{print $1 > "foo"}'
616 case `egrep -e \^$USER\: $PASSWD` in
619 cat $i >> $PASSWD
622 echo $USER already in passwd file
625 mv $i ../old.passdir/done_${i}
627 cd /afs/.example.com/common/uss/newaccts
628 echo "sorting password file"
629 sort ${PASSWD} > ${PASSWD}.sorted
630 echo "installing files"
631 install ${PASSWD}.sorted ${DEST}/passwd
632 echo "Password file is built, sorted and installed."
638 <primary>uss commands</primary>
640 <secondary>converting existing UNIX accounts</secondary>
644 <primary>converting</primary>
646 <secondary>existing UNIX accounts to AFS accounts</secondary>
648 <tertiary>with uss</tertiary>
652 <primary>user account</primary>
654 <secondary>converting existing UNIX to AFS</secondary>
656 <tertiary>with uss</tertiary>
661 <sect1 id="HDRWQ459">
662 <title>Converting Existing UNIX Accounts with uss</title>
664 <para>This section discusses the three main issues you need to consider if there are existing UNIX accounts to be converted to
667 <sect2 id="HDRWQ460">
668 <title>Making UNIX and AFS UIDs Match</title>
670 <para>As previously mentioned, AFS users must have an entry in the local password file on every client machine from which they
671 access the AFS filespace as an authenticated user. Both administration and use are much simpler if the UNIX UID and AFS UID
672 match. When converting existing UNIX accounts, you have two alternatives: <itemizedlist>
674 <para>Make the AFS UIDs match the existing UNIX UIDs. In this case, you need to assign the AFS UID yourself as you
675 create an AFS account: <itemizedlist>
677 <para>If using the <emphasis role="bold">uss add</emphasis> command, include the <emphasis
678 role="bold">-uid</emphasis> argument.</para>
682 <para>If using the <emphasis role="bold">uss bulk</emphasis> command, specify the desired UID in the uid field of
683 the <emphasis role="bold">add</emphasis> instruction in the bulk input file.</para>
685 </itemizedlist></para>
687 <para>Because you are retaining the user's UNIX UID, you do not need to alter the UID in the local password file entry.
688 However, if you are using an AFS-modified login utility, you possibly need to change the password field in the entry.
689 For a discussion of how the value in the password field affects login with an AFS-modified login utility, see <link
690 linkend="HDRWQ455">Creating Local Password File Entries with uss</link>.</para>
692 <para>If now or in the future you need to create AFS accounts for users who do not have an existing UNIX UID, then you
693 must guarantee that new AFS UIDs do not conflict with any existing UNIX UIDs. The simplest way is to set the
694 <computeroutput>max user id</computeroutput> counter in the Protection Database to a value higher than the largest
695 existing UNIX UID. See <link linkend="HDRWQ560">Displaying and Setting the AFS UID and GID Counters</link>.</para>
699 <para>Change the existing UNIX UIDs to match the new AFS UIDs that the Protection Server assigns automatically.</para>
701 <para>Allow the Protection Server to allocate the AFS UIDs automatically as you create AFS accounts. For instructions on
702 creating a new entry for the local password file during account creation, see <link linkend="HDRWQ455">Creating Local
703 Password File Entries with uss</link>.</para>
705 <para>There is one drawback to changing the UNIX UID: any files and directories that the user owned in the local file
706 system before becoming an AFS user still have the former UID in their owner field. If you want the <emphasis
707 role="bold">ls -l</emphasis> and <emphasis role="bold">ls -ld</emphasis> commands to display the correct owner, you must
708 use the <emphasis role="bold">chown</emphasis> command to change the value to the user's new UID, whether you are
709 leaving the file in the local file system or moving it to AFS. See <link linkend="HDRWQ462">Moving Local Files into
712 </itemizedlist></para>
715 <sect2 id="HDRWQ461">
716 <title>Setting the Password Field Appropriately</title>
718 <para>Existing UNIX accounts already have an entry in the local password file, probably with a (scrambled) password in the
719 password field. You possibly need to change the value in the field, depending on the type of login utility you use:
722 <para>If the login utility is not modified for use with AFS, the actual password must appear (in scrambled form) in the
723 password field of the local password file entry.</para>
727 <para>If the login utility is modified for use with AFS, choose one of the acceptable values, each of which affects the
728 login utility's behavior differently. See <link linkend="HDRWQ455">Creating Local Password File Entries with
731 </itemizedlist></para>
733 <para>If you choose to place an actual password in a local password file entry, then you can define a dummy password when you
734 use a template file <emphasis role="bold">E</emphasis> instruction to create the entry, as described in <link
735 linkend="HDRWQ476">Creating One-Line Files with the E Instruction</link>. Have the user issue the UNIX password-setting
736 command (<emphasis role="bold">passwd</emphasis> or equivalent) to replace the dummy with an actual secret password.</para>
739 <sect2 id="HDRWQ462">
740 <title>Moving Local Files into AFS</title>
742 <para>New AFS users with existing UNIX accounts probably already own files and directories stored in a machine's local file
743 system, and it usually makes sense to transfer them into the new home volume. The easiest method is to move them onto the
744 local disk of an AFS client machine, and then use the UNIX <emphasis role="bold">mv</emphasis> command to transfer them into
745 the user's new AFS home directory.</para>
747 <para>As you move files and directories into AFS, keep in mind that the meaning of their mode bits changes. AFS ignores the
748 second and third sets of mode bits (group and other), and does not use the first set (the owner bits) directly, but only in
749 conjunction with entries on the ACL (for details, see <link linkend="HDRWQ580">How AFS Interprets the UNIX Mode Bits</link>).
750 Be sure that the ACL protects the file or directory at least as securely as the mode bits.</para>
752 <para>If you have chosen to change a user's UNIX UID to match a new AFS UID, you must change the ownership of UNIX files and
753 directories as well. Only members of the <emphasis role="bold">system:administrators</emphasis> group can issue the <emphasis
754 role="bold">chown</emphasis> command on files and directories once they reside in AFS. <indexterm>
755 <primary>uss commands</primary>
757 <secondary>advantages over individual account-creation commands</secondary>
758 </indexterm> <indexterm>
759 <primary>uss template file</primary>
761 <secondary>advantages</secondary>
762 </indexterm> <indexterm>
763 <primary>uss template file</primary>
765 <secondary>instructions summarized</secondary>
770 <sect1 id="HDRWQ463">
771 <title>Constructing a uss Template File</title>
773 <para>Creating user accounts with <emphasis role="bold">uss</emphasis> commands is generally more convenient than using
774 individual commands. You control the account creation process just as closely, but the <emphasis role="bold">uss</emphasis>
775 template file enables you to predefine many aspects of account configuration. Because you construct the template before issuing
776 <emphasis role="bold">uss</emphasis> commands, you have time to consider configuration details carefully and correct syntax
777 errors. The following list summarizes some further advantages of using a template: <itemizedlist>
779 <para>You do not have to remember the correct order in which to create or delete account components, or the order of each
780 command's arguments, which reduces the likelihood of errors.</para>
784 <para>You do not have to type the same information multiple times. Instead, you can place constants and variables in the
785 template file that enable you to type as little on the command line as possible. See <link linkend="HDRWQ465">Using
786 Constants and Variables in the Template File</link>.</para>
790 <para>You can create different templates for different types of users. Instead of having to remember which components
791 differ for a given user, specify the appropriate template when issuing the <emphasis role="bold">uss add</emphasis> or
792 <emphasis role="bold">uss bulk</emphasis> command.</para>
796 <para>You can create any of the three types of AFS account (authentication-only, basic, or full) by including or omitting
797 certain information in the template, as described in <link linkend="HDRWQ464">Creating the Three Types of User
798 Accounts</link>.</para>
800 </itemizedlist></para>
802 <para>The following list briefly describes the instructions that can appear in a template file and points you to a later section
803 for more details. It lists them in the order that is usually optimal for correct handling of dependencies between the different
804 types of instruction. <variablelist>
806 <term><emphasis role="bold">G</emphasis></term>
809 <para>Defines a directory that is one of a set of parent directories into which the <emphasis role="bold">uss</emphasis>
810 command interpreter evenly distributes newly created home directories. Place the corresponding template file variable,
811 $AUTO, in the mount_point field of the <emphasis role="bold">V</emphasis> instruction. See <link
812 linkend="HDRWQ472">Evenly Distributing User Home Directories with the G Instruction</link> and <link
813 linkend="HDRWQ473">Creating a Volume with the V Instruction</link>.</para>
818 <term><emphasis role="bold">V</emphasis></term>
821 <para>Creates a volume, mounts it as the user's home directory at a specified location in the AFS filespace, sets the
822 volume's quota, and defines the owner and ACL for the directory. This instruction must appear in any template that is
823 not empty (zero-length). See <link linkend="HDRWQ473">Creating a Volume with the V Instruction</link>.</para>
828 <term><emphasis role="bold">D</emphasis></term>
831 <para>Creates a directory, generally a subdirectory of the new home directory, and sets its mode bits, owner, and ACL.
832 See <link linkend="HDRWQ474">Creating a Directory with the D Instruction</link>.</para>
837 <term><emphasis role="bold">F</emphasis></term>
840 <para>Creates a file by copying a prototype and sets its mode bits and owner. See <link linkend="HDRWQ475">Creating a
841 File from a Prototype with the F Instruction</link>.</para>
846 <term><emphasis role="bold">E</emphasis></term>
849 <para>Creates a single-line file by copying in the contents of the instruction itself, then sets the file's mode bits
850 and owner. See <link linkend="HDRWQ476">Creating One-Line Files with the E Instruction</link>.</para>
855 <term><emphasis role="bold">L</emphasis></term>
858 <para>Creates a hard link. See <link linkend="HDRWQ477">Creating Links with the L and S Instructions</link>.</para>
863 <term><emphasis role="bold">S</emphasis></term>
866 <para>Creates a symbolic link. See <link linkend="HDRWQ477">Creating Links with the L and S Instructions</link>.</para>
871 <term><emphasis role="bold">A</emphasis></term>
874 <para>Improves account security by imposing restrictions on passwords and authentication attempts. See <link
875 linkend="HDRWQ478">Increasing Account Security with the A Instruction</link>.</para>
880 <term><emphasis role="bold">X</emphasis></term>
883 <para>Executes a command. See <link linkend="HDRWQ479">Executing Commands with the X Instruction</link>.</para>
886 </variablelist></para>
889 <primary>uss template file</primary>
891 <secondary>instructions for different account types</secondary>
895 <primary>user account</primary>
897 <secondary>creating different types with uss</secondary>
901 <primary>creating</primary>
903 <secondary>user account types with uss</secondary>
906 <sect2 id="HDRWQ464">
907 <title>Creating the Three Types of User Accounts</title>
909 <para>Using the <emphasis role="bold">uss add</emphasis> and <emphasis role="bold">uss bulk</emphasis> commands, you can
910 create three types of accounts that differ in their levels of functionality. For a description of the types, see <link
911 linkend="HDRWQ57">Configuring AFS User Accounts</link>. The following list explains how to construct a template for each type:
914 <para>To create an authentication-only account, create an empty (zero-length) template file. Such an account has only
915 two components: entries in the Authentication Database and Protection Database.</para>
919 <para>To create a basic account, include a <emphasis role="bold">V</emphasis> instruction, and <emphasis
920 role="bold">G</emphasis> instructions if you want to distribute home directories evenly as described in <link
921 linkend="HDRWQ472">Evenly Distributing User Home Directories with the G Instruction</link>. In addition to
922 Authentication Database and Protection Database entries, this type of account includes a volume mounted at the home
923 directory with owner and ACL set appropriately.</para>
927 <para>To create a full account, include <emphasis role="bold">D</emphasis>, <emphasis role="bold">E</emphasis>,
928 <emphasis role="bold">F</emphasis>, <emphasis role="bold">L</emphasis>, and <emphasis role="bold">S</emphasis>
929 instructions as appropriate, in addition to the <emphasis role="bold">V</emphasis> and <emphasis
930 role="bold">G</emphasis> instructions. This type of account includes configuration files for basic functions such as
931 logging in, printing, and mail delivery. For a discussion of some useful types of configuration files, see <link
932 linkend="HDRWQ60">Creating Standard Files in New AFS Accounts</link>.</para>
934 </itemizedlist></para>
937 <primary>constants</primary>
939 <secondary>uss template file</secondary>
943 <primary>uss template file</primary>
945 <secondary>constants</secondary>
949 <primary>variables</primary>
951 <secondary>in uss template file</secondary>
955 <primary>uss template file</primary>
957 <secondary>variables</secondary>
961 <sect2 id="HDRWQ465">
962 <title>Using Constants and Variables in the Template File</title>
964 <para>Each instruction in the <emphasis role="bold">uss</emphasis> template file has several fields that define the
965 characteristics of the element that it creates. The <emphasis role="bold">D</emphasis> instruction's fields, for instance,
966 define a directory's pathname, owner, mode bits, and ACL.</para>
968 <para>You can place three types of values in a field: a variable, a constant, or a combination of the two. The appropriate
969 value depends on the desired configuration, and determines which arguments you provide to the <emphasis role="bold">uss
970 add</emphasis> command or which fields you include in a bulk input file <emphasis role="bold">add</emphasis>
973 <para>If an aspect of account configuration is the same for every user, define a constant value in the appropriate field by
974 inserting a character string. For example, to assign a space quota of 10,000 KB to every user volume, place the string
975 <emphasis role="bold">10000</emphasis> in the <emphasis role="bold">V</emphasis> instruction's quota field.</para>
977 <para>If, on the other hand, an aspect of account configuration varies for each user, put a variable in the appropriate field.
978 When creating each account, provide a value for the variable by providing either the corresponding argument to the <emphasis
979 role="bold">uss add</emphasis> command or a value in the corresponding field of the <emphasis role="bold">add</emphasis>
980 instruction in the bulk input file.</para>
982 <para>The <emphasis role="bold">uss</emphasis> command suite defines a set of template variables, each of which has a
983 corresponding source for its value, as summarized in <link linkend="TBLWQ466">Table 3</link>. For a discussion of their
984 intended uses, see the following sections about each template instruction (<link linkend="HDRWQ473">Creating a Volume with the
985 V Instruction</link> through <link linkend="HDRWQ479">Executing Commands with the X Instruction</link>).</para>
987 <table id="TBLWQ466" label="3">
988 <title>Source for values of uss template variables</title>
991 <colspec colwidth="20*" />
993 <colspec colwidth="80*" />
997 <entry><emphasis role="bold">Variable</emphasis></entry>
999 <entry><emphasis role="bold">Source for value</emphasis></entry>
1005 <entry>$AUTO</entry>
1007 <entry>Previous <emphasis role="bold">G</emphasis> instructions in template</entry>
1011 <entry>$MTPT</entry>
1013 <entry><emphasis role="bold">-mount</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or
1014 mount_point field of bulk input file <emphasis role="bold">add</emphasis> instruction, when in <emphasis
1015 role="bold">V</emphasis> instruction; <emphasis role="bold">V</emphasis> instruction's mount_point field when in
1016 subsequent instructions</entry>
1020 <entry>$NAME</entry>
1022 <entry><emphasis role="bold">-realname</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or
1023 mount_point field of bulk input file <emphasis role="bold">add</emphasis> instruction, if provided; otherwise,
1024 <emphasis role="bold">-user</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or username field
1025 of in bulk input file <emphasis role="bold">add</emphasis> instruction</entry>
1029 <entry>$PART</entry>
1031 <entry><emphasis role="bold">-partition</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or
1032 partition field of bulk input file <emphasis role="bold">add</emphasis> instruction</entry>
1036 <entry>$PWEXPIRES</entry>
1038 <entry><emphasis role="bold">-pwexpires</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or
1039 password_expires field of bulk input file <emphasis role="bold">add</emphasis> instruction</entry>
1043 <entry>$SERVER</entry>
1045 <entry><emphasis role="bold">-server</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or
1046 file_server field of bulk input file <emphasis role="bold">add</emphasis> instruction</entry>
1052 <entry><emphasis role="bold">-uid</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or uid field
1053 of bulk input file <emphasis role="bold">add</emphasis> instruction, if provided; otherwise, allocated automatically
1054 by Protection Server</entry>
1058 <entry>$USER</entry>
1060 <entry><emphasis role="bold">-user</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or username
1061 field of bulk input file <emphasis role="bold">add</emphasis> instruction</entry>
1065 <entry>$1 through $9</entry>
1067 <entry><emphasis role="bold">-var</emphasis> argument to <emphasis role="bold">uss add</emphasis> command or var1
1068 through var9 fields of bulk input file <emphasis role="bold">add</emphasis> instruction</entry>
1074 <para>A common use of variables is to define the file server machine and partition that house the user's volume, which often
1075 vary from user to user. Place the $SERVER variable in the <emphasis role="bold">V</emphasis> instruction's server field, and
1076 the $PART variable in its partition field. If using the <emphasis role="bold">uss add</emphasis> command, provide the desired
1077 value with the <emphasis role="bold">-server</emphasis> and <emphasis role="bold">-partition</emphasis> arguments. If using
1078 the <emphasis role="bold">uss bulk</emphasis> command, provide the desired values in the file_server and partition fields of
1079 each user's <emphasis role="bold">add</emphasis> instruction in the bulk input file. <indexterm>
1080 <primary>number variables</primary>
1082 <secondary>uss template file</secondary>
1083 </indexterm> <indexterm>
1084 <primary>uss template file</primary>
1086 <secondary>number variables</secondary>
1089 <para>The variables $1 through $9 can be used to customize other aspects of the account. Provide a value for these variables
1090 with the <emphasis role="bold">-var</emphasis> argument to the <emphasis role="bold">uss add</emphasis> command or in the
1091 appropriate field of the bulk input file <emphasis role="bold">add</emphasis> instruction. The <emphasis
1092 role="bold">-var</emphasis> argument is unusual in that each instance for it has two parts: the number index and the value,
1093 separated by a space. For examples of the use of a number variable, see the discussions of the mount_point and quota fields in
1094 <link linkend="HDRWQ473">Creating a Volume with the V Instruction</link>.</para>
1096 <para>If some aspect of account configuration is partly constant and partly variable, you can combine variables and constants
1097 in an instruction field. For example, suppose that the Example Corporation mounts user volumes in the <emphasis
1098 role="bold">/afs/example.com/usr</emphasis> directory. That part of the pathname is constant, but the name of the mount point and
1099 home directory is the user's username, which corresponds to the $USER variable. To configure accounts in this way, combine a
1100 constant string and a variable in the <emphasis role="bold">V</emphasis> instruction's mount_point field as follows:</para>
1103 /afs/example.com/usr/$USER
1106 <para>Then provide the value for the $USER variable with the <emphasis role="bold">-user</emphasis> argument to the <emphasis
1107 role="bold">uss add</emphasis> command, or in the username field of each user's <emphasis role="bold">add</emphasis>
1108 instruction in the bulk input file. <indexterm>
1109 <primary>location</primary>
1111 <secondary>standard for uss template file</secondary>
1112 </indexterm> <indexterm>
1113 <primary>uss template file</primary>
1115 <secondary>standard locations</secondary>
1119 <sect2 id="HDRWQ468">
1120 <title>Where to Place Template Files</title>
1122 <para>A template must be available to the <emphasis role="bold">uss</emphasis> command interpreter as it executes a <emphasis
1123 role="bold">uss add</emphasis> or <emphasis role="bold">uss bulk</emphasis> command, even if it is the zero-length file
1124 appropriate for creating an authentication-only account.</para>
1126 <para>If you do not provide the <emphasis role="bold">-template</emphasis> argument to the <emphasis role="bold">uss
1127 add</emphasis> or <emphasis role="bold">uss bulk</emphasis> command, then the command interpreter searches for a template file
1128 called <emphasis role="bold">uss.template</emphasis> in each of the following directories in turn: <orderedlist>
1130 <para>The current working directory</para>
1134 <para><emphasis role="bold">/afs/cellname/common/uss</emphasis>, where cellname is the local cell</para>
1138 <para><emphasis role="bold">/etc</emphasis></para>
1140 </orderedlist></para>
1142 <para>To use a template file with a different name or stored in a different directory, include the <emphasis
1143 role="bold">-template</emphasis> argument to the <emphasis role="bold">uss add</emphasis> or <emphasis role="bold">uss
1144 bulk</emphasis> command. If you provide a filename only, the command interpreter looks for it in the directories listed just
1145 previously. If you provide a pathname and filename, it looks only in the specified directory, interpreting a partial pathname
1146 relative to the current working directory. <indexterm>
1147 <primary>rules</primary>
1149 <secondary>uss template file</secondary>
1150 </indexterm> <indexterm>
1151 <primary>uss template file</primary>
1153 <secondary>rules for constructing</secondary>
1157 <sect2 id="HDRWQ469">
1158 <title>Some General Rules for Constructing a Template</title>
1160 <para>This section summarizes some general rules to follow when constructing a template file. For each instruction's syntax
1161 definition, see the following sections (<link linkend="HDRWQ472">Evenly Distributing User Home Directories with the G
1162 Instruction</link> through <link linkend="HDRWQ479">Executing Commands with the X Instruction</link>). <itemizedlist>
1164 <para>If a variable takes its value from an element elsewhere within the template, the definition must precede the
1165 reference. Putting the instruction lines in the following order usually results in correct resolution of
1168 <para><emphasis role="bold">G V D F E L S A X</emphasis></para>
1172 <para>The fields in each instruction must appear in the order specified by the instruction's syntax definition, which
1173 appear in the following sections about each instruction. You cannot omit a field. Separate each field from its neighbors
1174 with one or more spaces.</para>
1178 <para>When specifying a pathname, provide a full one. Partial pathnames are interpreted relative to the current working
1179 directory (the one in which the <emphasis role="bold">uss</emphasis> command is issued), with possibly unintended
1184 <para>Each instruction must appear on a single line in the template file, with a newline character (<emphasis
1185 role="bold"><Return></emphasis>) only at the end of the instruction. Some example instructions appear in this
1186 document on more than one line, but that is only for legibility.</para>
1190 <para>Provide a value for every variable that appears in the template by including the corresponding argument to the
1191 <emphasis role="bold">uss add</emphasis> command or placing a value in the corresponding field of the bulk input file
1192 <emphasis role="bold">add</emphasis> instruction. A missing value halts the entire creation operation. If a variable
1193 does not appear in the template file, the command interpreter ignores the corresponding command-line argument or field
1194 in the bulk input file, even if you provide it.</para>
1198 <para>You can use blank lines in the template file to increase its legibility. If you place comments in the file, begin
1199 each comment line with the number sign (<emphasis role="bold">#</emphasis>).</para>
1201 </itemizedlist></para>
1204 <sect2 id="HDRWQ470">
1205 <title>About Creating Local Disk Directories and Files</title>
1207 <para>It is possible to use the <emphasis role="bold">D</emphasis>, <emphasis role="bold">E</emphasis>, and <emphasis
1208 role="bold">F</emphasis> instructions to create directories or files in the local file system of the machine on which you are
1209 issuing the <emphasis role="bold">uss</emphasis> command, but that usage is not recommended. It introduces two potential
1210 complications: <itemizedlist>
1212 <para>The local file system automatically assigns ownership of a new local disk directory or file to its creator.
1213 Because you are the issuer of the <emphasis role="bold">uss</emphasis> command that is creating the object, it records
1214 your current UNIX UID. If that is not appropriate and you want to designate another owner as the object is created, then
1215 you must be logged in as the local superuser <emphasis role="bold">root</emphasis> (the local file system allows only
1216 the <emphasis role="bold">root</emphasis> user to issue the UNIX <emphasis role="bold">chown</emphasis> command, which
1217 the <emphasis role="bold">uss</emphasis> command interpreter invokes to change the owner from the default value). You
1218 must also use the <emphasis role="bold">-admin</emphasis> argument to the <emphasis role="bold">uss add</emphasis> or
1219 <emphasis role="bold">uss bulk</emphasis> command to authenticate as a privileged AFS administrator. Only an
1220 administrator can create Authentication Database and Protection Database entries, which the <emphasis
1221 role="bold">uss</emphasis> command interpreter always creates as part of a new account.</para>
1223 <para>The alternative is to become the local superuser <emphasis role="bold">root</emphasis> after the <emphasis
1224 role="bold">uss</emphasis> operation completes, and issue the necessary <emphasis role="bold">chown</emphasis> command
1225 then. However, that makes the account creation process that much less automated.</para>
1229 <para>Creating a local disk directory always generates an error message because the <emphasis role="bold">uss</emphasis>
1230 command interpreter cannot successfully set a local directory's ACL. The directory is created nevertheless, and a value
1231 still must appear in the <emphasis role="bold">D</emphasis> instruction's ACL field.</para>
1233 </itemizedlist></para>
1236 <sect2 id="HDRWQ471">
1237 <title>Example uss Templates</title>
1239 <para>This section describes example templates for the basic and full account types (the template for an authentication-only
1240 account is empty).</para>
1242 <para>The first example creates a basic account. It contains two <emphasis role="bold">G</emphasis> instructions and a
1243 <emphasis role="bold">V</emphasis> instruction that defines the volume name, file server machine, partition, quota in
1244 kilobytes, mount point, home directory owner, and home directory access control list. In the Example Corporation cell, a suitable
1248 G /afs/.example.com/usr1
1249 G /afs/.example.com/usr2
1250 V user.$USER $SERVER.example.com /vicep$PART 5000 $AUTO/$USER $UID \
1254 <para>When issuing the <emphasis role="bold">uss add</emphasis> command with this type of template, provide the following
1255 arguments: <itemizedlist>
1257 <para><emphasis role="bold">-user</emphasis> to specify the username for the $USER variable</para>
1261 <para><emphasis role="bold">-server</emphasis> to specify the unique part of the file server machine name for the
1262 $SERVER variable</para>
1266 <para><emphasis role="bold">-partition</emphasis> to specify the unique part of the partition name for the $PART
1269 </itemizedlist></para>
1271 <para>The Protection Server automatically assigns an AFS UID for the $UID variable, and the <emphasis role="bold">G</emphasis>
1272 instructions provide a value for the $AUTO variable.</para>
1274 <para>The following example template file creates a full account in the Example Corporation cell. The following sections about
1275 each type of instruction describe the effect of the examples. Note that the <emphasis role="bold">V</emphasis> and <emphasis
1276 role="bold">E</emphasis> instructions appear on two lines each only for the sake of legibility.</para>
1280 # Specify the available grouping directories
1282 G /afs/.example.com/usr1
1283 G /afs/.example.com/usr2
1285 # Create the user's home volume
1287 V user.$USER $SERVER.example.com /vicep$PART 5000 /afs/.example.com/$AUTO/$USER \
1288 $UID $USER all abc:staff rl
1290 # Create directories and files for mail
1292 D $MTPT/.MESSAGES 0700 $UID $USER all abc:staff none
1293 D $MTPT/.Outgoing 0700 $UID $USER rlidwk postman rlidwk
1294 D $MTPT/Mailbox 0700 $UID $USER all abc:staff none system:anyuser lik
1296 # Here are some useful scripts for login etc.
1298 F $MTPT/.Xbiff 0755 $UID /afs/example.com/admin/user/proto
1299 F $MTPT/.Xresources 0644 $UID /afs/example.com/admin/user/proto
1300 F $MTPT/.Xsession 0755 $UID /afs/example.com/admin/user/proto
1301 F $MTPT/.cshrc 0755 $UID /afs/example.com/admin/user/proto
1302 F $MTPT/.login 0755 $UID /afs/example.com/admin/user/proto
1303 F $MTPT/.logout 0755 $UID /afs/example.com/admin/user/proto
1304 F $MTPT/.twmrc 0644 $UID /afs/example.com/admin/user/proto
1305 F $MTPT/preferences 0644 $UID /afs/example.com/admin/user/proto
1307 # Make a passwd entry
1309 E /afs/.example.com/common/etc/newaccts/passwd_$USER 0644 root \
1310 "$USER:X:$UID:11:$NAME:$MTPT:/bin/csh"
1312 # Put in the standard password/authentication checks
1314 A $USER 250 noreuse 9 25
1316 # Create and mount a public volume for the user
1318 X "create_public_vol $USER $1 $2"
1320 # Here we set up the symbolic link to public directory
1322 S /afs/example.com/public/$USER $MTPT/public
1326 <primary>uss commands</primary>
1328 <secondary>directory</secondary>
1330 <tertiary>distributing evenly with G instruction</tertiary>
1334 <primary>defining</primary>
1336 <secondary>directory for even distribution of accounts with uss</secondary>
1340 <primary>directory</primary>
1342 <secondary>defining for even distribution of accounts with uss</secondary>
1346 <primary>uss template file</primary>
1348 <secondary>G instruction</secondary>
1352 <primary>uss template file</primary>
1354 <secondary>directory</secondary>
1356 <tertiary>G instruction for even distribution</tertiary>
1360 <sect2 id="HDRWQ472">
1361 <title>Evenly Distributing User Home Directories with the G Instruction</title>
1363 <para>In cells with thousands of user accounts, it often makes sense to distribute the mount points for user volumes into
1364 multiple parent directories, because placing them all in one directory noticeably slows down directory lookup when a user home
1365 directory is accessed. A possible solution is to create parent directories that group user home directories alphabetically, or
1366 that reflect divisions like academic or corporate departments. However, in a really large cell, some such groups can still be
1367 large enough to slow directory lookup, and users who belong to those groups are unfairly penalized every time they access
1368 their home directory. Another drawback to groupings that reflect workplace divisions is that you must move mount points when
1369 users change departmental affiliation.</para>
1371 <para>An alternative is an even distribution of user home directories into multiple parent directories that do not represent
1372 workplace divisions. The <emphasis role="bold">uss</emphasis> command suite enables you to define a list of directories by
1373 placing a <emphasis role="bold">G</emphasis> instruction for each one at the top of the template file, and then using the
1374 $AUTO variable in the <emphasis role="bold">V</emphasis> instruction's mount_point field. When the <emphasis
1375 role="bold">uss</emphasis> command interpreter encounters the $AUTO variable, it substitutes the directory named by a
1376 <emphasis role="bold">G</emphasis> instruction that currently has the fewest entries. (Actually, the $AUTO variable can appear
1377 in any field that includes a pathname, in any type of instruction. In all cases, the command interpreter substitutes the
1378 directory that currently has the fewest entries.)</para>
1380 <para>The <emphasis role="bold">G</emphasis> instruction's syntax is as follows:</para>
1386 <para>where directory specifies either a complete directory pathname or only the final element (the directory itself). The
1387 choice determines the appropriate value to place in the <emphasis role="bold">V</emphasis> instruction's mount_point
1390 <para>Specify the read/write path to each directory, to avoid the failure that results when you attempt to create a new mount
1391 point in a read-only volume. By convention, you indicate the read/write path by placing a period before the cell name at the
1392 pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). For further discussion of the concept
1393 of read/write and read-only paths through the filespace, see <link linkend="HDRWQ208">Mounting Volumes</link>.</para>
1395 <para>For example, the Example Corporation example template for a full account in <link linkend="HDRWQ471">Example uss
1396 Templates</link> defines two directories:</para>
1399 G /afs/.example.com/usr1
1400 G /afs/.example.com/usr2
1403 <para>and puts the value <emphasis role="bold">$AUTO/$USER</emphasis> in the <emphasis role="bold">V</emphasis> instruction's
1404 mount_point field. An alternative with the same result is to define the directories as follows:</para>
1411 <para>and specify a more complete pathname in the <emphasis role="bold">V</emphasis> instruction's mount_point field:
1412 <emphasis role="bold">/afs/.example.com/$AUTO/$USER</emphasis>. <indexterm>
1413 <primary>uss commands</primary>
1415 <secondary>volume</secondary>
1417 <tertiary>creating with V instruction</tertiary>
1418 </indexterm> <indexterm>
1419 <primary>creating</primary>
1421 <secondary>volume with uss</secondary>
1422 </indexterm> <indexterm>
1423 <primary>volume</primary>
1425 <secondary>creating with uss</secondary>
1426 </indexterm> <indexterm>
1427 <primary>uss template file</primary>
1429 <secondary>V instruction</secondary>
1430 </indexterm> <indexterm>
1431 <primary>uss template file</primary>
1433 <secondary>volume</secondary>
1435 <tertiary>creating with V instruction</tertiary>
1436 </indexterm> <indexterm>
1437 <primary>uss template file</primary>
1439 <secondary>zero-length</secondary>
1443 <sect2 id="HDRWQ473">
1444 <title>Creating a Volume with the V Instruction</title>
1446 <para>Unless the template file is empty (zero-length), one and only one <emphasis role="bold">V</emphasis> instruction must
1447 appear in it. (To create other volumes for a user as part of a <emphasis role="bold">uss</emphasis> account-creation
1448 operation, use the <emphasis role="bold">X</emphasis> instruction to invoke the <emphasis role="bold">vos create</emphasis>
1449 command or a script that invokes that command along with others, such as the <emphasis role="bold">fs mkmount</emphasis>
1450 command. For an example, see <link linkend="HDRWQ479">Executing Commands with the X Instruction</link>.)</para>
1452 <para>The <emphasis role="bold">V</emphasis> instruction defines the following AFS entities:</para>
1456 <para>A volume and associated VLDB entry</para>
1460 <para>The volume's site (file server machine and partition)</para>
1464 <para>The volume's mount point in the AFS filespace, which becomes the user's home directory</para>
1468 <para>The volume's space quota</para>
1472 <para>The home directory's owner, usually the new user</para>
1476 <para>The home directory's ACL, which normally at least grants all permissions to the user</para>
1480 <para>The following discussion of the fields in a <emphasis role="bold">V</emphasis> instruction refers to the example in the
1481 full account template from <link linkend="HDRWQ471">Example uss Templates</link> (the instruction appears here on two lines
1482 only for legibility):</para>
1485 V user.$USER $SERVER.example.com /vicep$PART 5000 \
1486 /afs/.example.com/$AUTO/$USER $UID $USER all abc:staff rl
1489 <para>The <emphasis role="bold">V</emphasis> instruction's syntax is as follows:</para>
1492 V volume_name server partition quota mount_point owner ACL
1495 <para>where <variablelist>
1497 <term><emphasis role="bold">V</emphasis></term>
1500 <para>Indicates a volume creation instruction.</para>
1505 <term><emphasis role="bold">volume_name</emphasis></term>
1508 <para>Specifies the volume's name as recorded in the VLDB.</para>
1510 <para>To follow the convention of including the user's name as part of the volume name, include the $USER variable in
1511 this field. The variable takes its value from the <emphasis role="bold">-user</emphasis> argument to the <emphasis
1512 role="bold">uss add</emphasis> command or from the bulk input file <emphasis role="bold">add</emphasis> instruction's
1513 username field.</para>
1515 <para>The Example Corporation example uses the value <emphasis role="bold">user.$USER</emphasis> to assign the
1516 conventional volume name, <emphasis role="bold">user.</emphasis>username. When creating an account for user <emphasis
1517 role="bold">smith</emphasis>, for example, you then include <emphasis role="bold">-user smith</emphasis> as an
1518 argument to the <emphasis role="bold">uss add</emphasis> command, or place the value <emphasis
1519 role="bold">smith</emphasis> in the bulk input file <emphasis role="bold">add</emphasis> instruction's username
1525 <term><emphasis role="bold">server</emphasis></term>
1528 <para>Names the file server machine on which to create the new volume. It is best to provide a fully qualified host
1529 name (for example, <emphasis role="bold">fs1.example.com</emphasis>), but an abbreviated form is acceptable if the cell's
1530 naming service is available to resolve it at the time the volume is created.</para>
1532 <para>To place different users' volumes on different file server machines, use the $SERVER variable in this field, and
1533 provide a value for it either with the <emphasis role="bold">-server</emphasis> argument to the <emphasis
1534 role="bold">uss add</emphasis> command or in the server field of the bulk input file <emphasis
1535 role="bold">add</emphasis> instruction. One easy way to specify a fully qualified hostname without having to type it
1536 completely on the command line is to combine a constant and the $SERVER variable. Specifically, the constant specifies
1537 the domain-name suffix common to all the file server machines.</para>
1539 <para>In the Example Corporation example, all of the file server machines in the cell share the <emphasis
1540 role="bold">example.com</emphasis> domain name suffix, so the server field combines a variable and constant: <emphasis
1541 role="bold">$SERVER.example.com</emphasis>. To place the new volume on the machine <emphasis
1542 role="bold">fs1.example.com</emphasis>, you then include <emphasis role="bold">-server fs1</emphasis> as an argument to
1543 the <emphasis role="bold">uss add</emphasis> command, or place the value <emphasis role="bold">fs1</emphasis> in the
1544 bulk input file <emphasis role="bold">add</emphasis> instruction's server field.</para>
1549 <term><emphasis role="bold">partition</emphasis></term>
1552 <para>Specifies the partition on which to create the user's volume; it must be on the file server machine named in the
1553 server field. Identify the partition by its complete name (for example, <emphasis role="bold">/vicepa</emphasis>) or
1554 use one of the abbreviations listed in <link linkend="HDRWQ615">Rules for Using Abbreviations and
1555 Aliases</link>.</para>
1557 <para>To place different users' volumes on different partitions, use the $PART variable in this field, and provide a
1558 value for it either with the <emphasis role="bold">-partition</emphasis> argument to the <emphasis role="bold">uss
1559 add</emphasis> command or in the partition field of the bulk input file <emphasis role="bold">add</emphasis>
1560 instruction. Because all full partition names start with the <emphasis role="bold">/vicep</emphasis> string, it is
1561 convenient to combine that string as a constant with the $PART variable.</para>
1563 <para>The Example Corporation example template combines the constant string <emphasis role="bold">/vicep</emphasis> and
1564 the $PART variable in this way, as <emphasis role="bold">/vicep$PART</emphasis>. <indexterm>
1565 <primary>uss commands</primary>
1567 <secondary>volume</secondary>
1569 <tertiary>setting quota</tertiary>
1570 </indexterm> <indexterm>
1571 <primary>volume quota</primary>
1573 <secondary>setting</secondary>
1575 <tertiary>with uss</tertiary>
1576 </indexterm> <indexterm>
1577 <primary>uss template file</primary>
1579 <secondary>quota on volume, setting with V instruction</secondary>
1580 </indexterm> <indexterm>
1581 <primary>setting</primary>
1583 <secondary>volume quota with uss</secondary>
1589 <term><emphasis role="bold">quota</emphasis></term>
1592 <para>Sets the maximum number of kilobyte blocks the volume can occupy on the file server machine's disk. It must be
1593 an integer. If you assign the same quota to all user volumes, specify a constant value. To assign different quotas to
1594 different volumes, place one of the number variables ($1 through $9) in this field, and provide a value for it either
1595 with the <emphasis role="bold">-var</emphasis> argument to the <emphasis role="bold">uss add</emphasis> command or in
1596 the appropriate field of the bulk input file <emphasis role="bold">add</emphasis> instruction.</para>
1598 <para>The Example Corporation example grants a 5000 KB initial quota to every new user. <indexterm>
1599 <primary>uss commands</primary>
1601 <secondary>volume</secondary>
1603 <tertiary>mounting</tertiary>
1604 </indexterm> <indexterm>
1605 <primary>creating</primary>
1607 <secondary>mount point with uss</secondary>
1608 </indexterm> <indexterm>
1609 <primary>uss template file</primary>
1611 <secondary>mount point, creating with V instruction</secondary>
1612 </indexterm> <indexterm>
1613 <primary>mount point</primary>
1615 <secondary>creating with uss</secondary>
1621 <term><emphasis role="bold">mount_point</emphasis></term>
1624 <para>Creates a mount point for the volume, which serves as the volume's root directory and the user's home directory.
1625 By convention, user home directory names include the username, which you can read in by including the $USER variable
1626 in this field.</para>
1628 <para>Specify the read/write path to the mount point, to avoid the failure that results when you attempt to create the
1629 new mount point in a read-only volume. By convention, you indicate the read/write path by placing a period before the
1630 cell name at the pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). If you use the
1631 $AUTO variable in this field, the directories named by each <emphasis role="bold">G</emphasis> instruction possibly
1632 already indicate the read/write path. For further discussion of the concept of read/write and read-only paths through
1633 the filespace, see <link linkend="HDRWQ208">Mounting Volumes</link>.</para>
1635 <para>If other parts of the mount point name also vary from user to user, you can use the $MTPT variable in this
1636 field, and provide a value with the <emphasis role="bold">uss add</emphasis> command's <emphasis
1637 role="bold">-mount</emphasis> argument or in the mount_point field of a bulk input file <emphasis
1638 role="bold">add</emphasis> instruction. Note, however, that when the $MTPT variable appears in subsequent instructions
1639 in the template (usually, in <emphasis role="bold">D</emphasis>, <emphasis role="bold">E</emphasis>, or <emphasis
1640 role="bold">F</emphasis> instructions), it instead takes as its value the complete contents of this field.</para>
1642 <para>Combine constants and variables based on how you have decided to group home directories together in one or more
1643 parent directories. Note that the parent directories must already exist before you run a <emphasis role="bold">uss
1644 add</emphasis> or <emphasis role="bold">uss bulk</emphasis> command that references the template. Possibilities for
1645 grouping home directories include the following: <indexterm>
1646 <primary>user account</primary>
1648 <secondary>methods for grouping</secondary>
1649 </indexterm> <itemizedlist>
1651 <para>Placing all user home directories in a single parent directory; the name <emphasis
1652 role="bold">/afs/</emphasis>cellname<emphasis role="bold">/usr</emphasis> is an AFS-appropriate variation on the
1653 UNIX <emphasis role="bold">/usr</emphasis> convention. This choice is most appropriate for a cell with a small
1654 number of user accounts. The simplest way to implement this choice is to combine a constant string and the $USER
1655 variable, as in <emphasis role="bold">/afs/.example.com/usr/$USER</emphasis>.</para>
1659 <para>Distributing home directories evenly into a set of parent directories that do not correspond to workplace
1660 divisions. This choice is appropriate in cells with tens of thousands of accounts, where the number of home
1661 directories is large enough to slow directory lookup significantly if they all reside together in one parent
1662 directory, but distribution according to workplace divisions is not feasible.</para>
1664 <para>The $AUTO variable is designed to distribute home directories evenly in this manner. As explained in <link
1665 linkend="HDRWQ472">Evenly Distributing User Home Directories with the G Instruction</link>, the <emphasis
1666 role="bold">uss</emphasis> command interpreter substitutes the directory that is defined by a preceding
1667 <emphasis role="bold">G</emphasis> template instruction and that currently has the fewest entries. The example
1668 Example Corporation template illustrates this choice by using the value <emphasis
1669 role="bold">/afs/.example.com/$AUTO/$USER</emphasis>.</para>
1673 <para>Distributing home directories into multiple directories that reflect divisions like academic or corporate
1674 departments. Perhaps the simplest way to implement this scheme is to use the $MTPT variable to represent the
1675 department, as in <emphasis role="bold">/afs/.example.com/usr/$MTPT/$USER</emphasis>. You then provide <emphasis
1676 role="bold">-user smith</emphasis> and <emphasis role="bold">-mount acctg</emphasis> arguments to the <emphasis
1677 role="bold">uss add</emphasis> command to create the mount point <emphasis
1678 role="bold">/afs/.example.com/usr/acctg/smith</emphasis>.</para>
1682 <para>Distributing home directories into alphabetic subdirectories of <emphasis role="bold">usr</emphasis>
1683 (<emphasis role="bold">usr/a</emphasis>, <emphasis role="bold">usr/b</emphasis> and so on), based on the first
1684 letter or letters in the username. The advantage is that knowing the username enables you easily to locate a
1685 home directory. A potential drawback is that the distribution is not likely to be even, and if there are a large
1686 number of accounts, then slowed directory lookup unfairly affects users whose names begins with popular
1689 <para>Perhaps the simplest way to implement this scheme is to use the $MTPT variable to represent the letter or
1690 letters, as in <emphasis role="bold">/afs/.example.com/usr/$MTPT/$USER</emphasis>. Then provide the <emphasis
1691 role="bold">-user smith</emphasis> and <emphasis role="bold">-mount s/m</emphasis> arguments to the <emphasis
1692 role="bold">uss add</emphasis> command to create the mount point <emphasis
1693 role="bold">/afs/.example.com/usr/s/m/smith</emphasis>.</para>
1695 </itemizedlist></para>
1700 <term><emphasis role="bold">owner</emphasis></term>
1703 <para>Specifies the username or UID of the user to be designated the mount point's owner in the output from the UNIX
1704 <emphasis role="bold">ls -ld</emphasis> command. To follow the standard convention for home directory ownership, use
1705 the $UID variable in this field, as in the Example Corporation example template. The Protection Server then automatically
1706 assigns an AFS UID unless you provide the <emphasis role="bold">-uid</emphasis> argument to the <emphasis
1707 role="bold">uss add</emphasis> command or fill in the uid field in the bulk input file <emphasis
1708 role="bold">add</emphasis> instruction. (If you are converting existing UNIX accounts, see the discussion of
1709 additional considerations in <link linkend="HDRWQ459">Converting Existing UNIX Accounts with uss</link>.) <indexterm>
1710 <primary>uss commands</primary>
1712 <secondary>ACL, setting on home directory</secondary>
1713 </indexterm> <indexterm>
1714 <primary>ACL</primary>
1716 <secondary>setting on user home directory with uss</secondary>
1717 </indexterm> <indexterm>
1718 <primary>uss template file</primary>
1720 <secondary>ACL, setting</secondary>
1722 <tertiary>user home directory with V instruction</tertiary>
1723 </indexterm> <indexterm>
1724 <primary>setting</primary>
1726 <secondary>ACL on home directory with uss</secondary>
1732 <term><emphasis role="bold">ACL</emphasis></term>
1735 <para>Sets the ACL on the new home directory. Provide one or more paired values, each pair consisting of an AFS
1736 username or group name and the desired permissions, in that order (a group name must already exist in the Protection
1737 Database to be used). Separate the two parts of the pair, and each pair, with a space. For a discussion of the
1738 available permissions, see <link linkend="HDRWQ567">The AFS ACL Permissions</link>.</para>
1740 <para>At minimum, grant all permissions to the new user by including the value <emphasis role="bold">$USER
1741 all</emphasis> in this field. The File Server automatically grants all permissions to the <emphasis
1742 role="bold">system:administrators</emphasis> group as well. You cannot grant permissions to the issuer of the
1743 <emphasis role="bold">uss</emphasis> command, because as the last step in account creation the <emphasis
1744 role="bold">uss</emphasis> command interpreter automatically deletes that user from any ACLs set during the creation
1747 <para>The Example Corporation example uses the following value to grant all permissions to the new user and <emphasis
1748 role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) and <emphasis role="bold">l</emphasis> (<emphasis
1749 role="bold">lookup</emphasis>) permissions to the members of the <emphasis role="bold">abc:staff</emphasis>
1752 <para><emphasis role="bold">$USER all abc:staff rl</emphasis></para>
1755 </variablelist></para>
1758 <primary>uss template file</primary>
1760 <secondary>D instruction</secondary>
1764 <primary>uss commands</primary>
1766 <secondary>directory</secondary>
1768 <tertiary>creating</tertiary>
1772 <primary>uss template file</primary>
1774 <secondary>directory</secondary>
1776 <tertiary>creating with D instruction</tertiary>
1780 <primary>creating</primary>
1782 <secondary>directory with uss</secondary>
1786 <primary>directory</primary>
1788 <secondary>creating with uss</secondary>
1792 <primary>D instruction</primary>
1794 <secondary>uss template file</secondary>
1798 <sect2 id="HDRWQ474">
1799 <title>Creating a Directory with the D Instruction</title>
1801 <para>Each <emphasis role="bold">D</emphasis> instruction in the template file creates a directory; there is no limit on the
1802 number of them in the template. If a <emphasis role="bold">D</emphasis> instruction creates a subdirectory in a new user's
1803 home directory (its intended use), then it must follow the <emphasis role="bold">V</emphasis> instruction. Creating a
1804 directory on the local disk of the machine where the <emphasis role="bold">uss</emphasis> command runs is not recommended for
1805 the reasons outlined in <link linkend="HDRWQ470">About Creating Local Disk Directories and Files</link>.</para>
1807 <para>The following discussion of the fields in a <emphasis role="bold">D</emphasis> instruction refers to one of the examples
1808 in the full account template in <link linkend="HDRWQ471">Example uss Templates</link>:</para>
1811 D $MTPT/Mailbox 0700 $UID $USER all abc:staff none system:anyuser lik
1814 <para>The <emphasis role="bold">D</emphasis> instruction's syntax is as follows:</para>
1817 D pathname mode_bits owner ACL
1820 <para>where <variablelist>
1822 <term><emphasis role="bold">D</emphasis></term>
1825 <para>Indicates a directory creation instruction.</para>
1830 <term><emphasis role="bold">pathname</emphasis></term>
1833 <para>Specifies the directory's full pathname. If it is a subdirectory of the user's home directory, it is simplest to
1834 use the $MTPT variable to specify the home directory pathname. When the $MTPT variable appears in a <emphasis
1835 role="bold">D</emphasis> instruction, it takes its value from the preceding <emphasis role="bold">V</emphasis>
1836 instruction's mount_point field (this dependency is why a <emphasis role="bold">D</emphasis> instruction must follow
1837 the <emphasis role="bold">V</emphasis> instruction).</para>
1839 <para>Specify the read/write pathname to the directory, to avoid the failure that results when you attempt to create a
1840 new directory in a read-only volume. By convention, you indicate the read/write path by placing a period before the
1841 cell name at the pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). If you use the
1842 $MTPT variable in this field, the value in the <emphasis role="bold">V</emphasis> instruction's mount_point field
1843 possibly already indicates the read/write path. For further discussion of the concept of read/write and read-only
1844 paths through the filespace, see <link linkend="HDRWQ208">Mounting Volumes</link>.</para>
1846 <para>The Example Corporation example uses the value <emphasis role="bold">$MTPT/Mailbox</emphasis> to place the <emphasis
1847 role="bold">Mailbox</emphasis> subdirectory in the user's home directory.</para>
1852 <term><emphasis role="bold">mode_bits</emphasis></term>
1855 <para>Defines the directory's UNIX mode bits. Acceptable values are the standard three- or four-digit numbers
1856 corresponding to a combination of permissions. Examples: <emphasis role="bold">0755</emphasis> corresponds to
1857 <emphasis role="bold">rwxr-xr-x</emphasis>, and <emphasis role="bold">0644</emphasis> to <emphasis
1858 role="bold">rw-r--r--</emphasis>. The first (owner) <emphasis role="bold">x</emphasis> bit must be turned on to enable
1859 access to a directory.</para>
1861 <para>The Example Corporation example uses the value <emphasis role="bold">0700</emphasis> to set the mode bits on the
1862 <emphasis role="bold">Mailbox</emphasis> subdirectory to <emphasis role="bold">rwxr-----</emphasis>.</para>
1867 <term><emphasis role="bold">owner</emphasis></term>
1870 <para>Specifies the username or UID of the user to be designated the directory's owner in the output from the UNIX
1871 <emphasis role="bold">ls -ld</emphasis> command.</para>
1873 <para>If the directory resides in AFS, place the $UID variable in this field, as in the Example Corporation example
1874 template. The Protection Server then automatically assigns an AFS UID unless you provide the <emphasis
1875 role="bold">-uid</emphasis> argument to the <emphasis role="bold">uss add</emphasis> command or fill in the uid field
1876 in the bulk input file <emphasis role="bold">add</emphasis> instruction. (If you are converting existing UNIX
1877 accounts, see the discussion of additional considerations in <link linkend="HDRWQ459">Converting Existing UNIX
1878 Accounts with uss</link>.)</para>
1880 <para>If the directory resides on the local disk, it is simplest to specify the username or UNIX UID under which you
1881 are issuing the <emphasis role="bold">uss</emphasis> command. For a discussion of the complications that arise from
1882 designating another user, see <link linkend="HDRWQ470">About Creating Local Disk Directories and Files</link>.
1884 <primary>ACL</primary>
1886 <secondary>setting for directory with uss</secondary>
1887 </indexterm> <indexterm>
1888 <primary>setting</primary>
1890 <secondary>ACL for directory with uss</secondary>
1891 </indexterm> <indexterm>
1892 <primary>uss template file</primary>
1894 <secondary>ACL, setting</secondary>
1896 <tertiary>directory created by D instruction</tertiary>
1897 </indexterm> <indexterm>
1898 <primary>uss commands</primary>
1900 <secondary>ACL, setting for directory</secondary>
1906 <term><emphasis role="bold">ACL</emphasis></term>
1909 <para>Sets the ACL on the new directory. Provide one or more paired values, each pair consisting of an AFS username or
1910 group name and the desired permissions, in that order (a group name must already exist in the Protection Database to
1911 be used). Separate the two parts of the pair, and each pair, with a space. For a description of the available
1912 permissions, see <link linkend="HDRWQ567">The AFS ACL Permissions</link>.</para>
1914 <para>At minimum, grant all permissions to the new user by including the value <emphasis role="bold">$USER
1915 all</emphasis>. You cannot grant permissions to the issuer of the <emphasis role="bold">uss</emphasis> command,
1916 because as the last step in account creation the <emphasis role="bold">uss</emphasis> command interpreter
1917 automatically deletes that user from any ACLs set during the creation process. An error message always appears if the
1918 directory is on the local disk, as detailed in <link linkend="HDRWQ470">About Creating Local Disk Directories and
1919 Files</link>.</para>
1921 <para>The Example Corporation example uses the following value to grant all permissions to the new user, no permissions to
1922 the members of the <emphasis role="bold">abc:staff</emphasis> group, and the <emphasis role="bold">l</emphasis>
1923 (<emphasis role="bold">lookup</emphasis>), <emphasis role="bold">i</emphasis> (<emphasis
1924 role="bold">insert</emphasis>), and <emphasis role="bold">k</emphasis> (<emphasis role="bold">lock</emphasis>)
1925 permissions to the members of the <emphasis role="bold">system:anyuser</emphasis> group:</para>
1927 <para><emphasis role="bold">$USER all abc:staff none system:anyuser lik</emphasis></para>
1929 <para>It grants such extensive permissions to the <emphasis role="bold">system:anyuser</emphasis> group to enable any
1930 system user (including a mail-delivery daemon) to insert mail into the <emphasis role="bold">Mailbox</emphasis>
1931 directory. The absence of the <emphasis role="bold">r</emphasis> (<emphasis role="bold">read</emphasis>) permission
1932 prevents members of the <emphasis role="bold">system:anyuser</emphasis> group from reading the mail files.</para>
1935 </variablelist></para>
1938 <primary>uss commands</primary>
1940 <secondary>file, creating from prototype</secondary>
1944 <primary>creating</primary>
1946 <secondary>file with uss</secondary>
1950 <primary>file</primary>
1952 <secondary>creating with uss</secondary>
1956 <primary>uss template file</primary>
1958 <secondary>F instruction</secondary>
1962 <primary>uss template file</primary>
1964 <secondary>file</secondary>
1966 <tertiary>creating from prototype</tertiary>
1970 <primary>F instruction</primary>
1972 <secondary>uss template file</secondary>
1976 <sect2 id="HDRWQ475">
1977 <title>Creating a File from a Prototype with the F Instruction</title>
1979 <para>Each <emphasis role="bold">F</emphasis> instruction in the template file creates a file by copying the contents of an
1980 existing prototype file; there is no limit on the number of them in the template, and each can refer to a different prototype.
1981 If an <emphasis role="bold">F</emphasis> instruction creates a file in a new user's home directory or a subdirectory of it
1982 (the intended use), then it must follow the <emphasis role="bold">V</emphasis> or <emphasis role="bold">D</emphasis>
1983 instruction that creates the parent directory. Creating a file on the local disk of the machine where the <emphasis
1984 role="bold">uss</emphasis> command runs is not recommended for the reasons detailed in <link linkend="HDRWQ470">About Creating
1985 Local Disk Directories and Files</link>.</para>
1987 <para>The <emphasis role="bold">E</emphasis> instruction also creates a file, but the two types of instruction have
1988 complementary advantages. Files created with an <emphasis role="bold">E</emphasis> instruction can be customized for each
1989 user, because variables can appear in the field that specifies the contents of the file. In contrast, the contents of a file
1990 created using the <emphasis role="bold">F</emphasis> instruction are the same for every user. An <emphasis
1991 role="bold">E</emphasis> file can be only a single line, however, whereas an <emphasis role="bold">F</emphasis> file can be
1994 <para>The following discussion of the fields in a <emphasis role="bold">F</emphasis> instruction refers to one of the examples
1995 in the full account template in <link linkend="HDRWQ471">Example uss Templates</link>:</para>
1998 F $MTPT/.login 0755 $UID /afs/example.com/admin/user/proto
2001 <para>The <emphasis role="bold">F</emphasis> instruction's syntax is as follows:</para>
2004 F pathname mode_bits owner prototype_file
2007 <para>where <variablelist>
2009 <term><emphasis role="bold">F</emphasis></term>
2012 <para>Indicates a file creation instruction.</para>
2017 <term><emphasis role="bold">pathname</emphasis></term>
2020 <para>Specifies the full pathname of the file to create, including the filename. If it resides in the user's home
2021 directory or a subdirectory of it, it is simplest to use the $MTPT variable to specify the home directory pathname.
2022 When the $MTPT variable appears in an <emphasis role="bold">F</emphasis> instruction, it takes its value from the
2023 preceding <emphasis role="bold">V</emphasis> instruction's mount_point field (this dependency is why an <emphasis
2024 role="bold">F</emphasis> instruction must follow the <emphasis role="bold">V</emphasis> instruction).</para>
2026 <para>Specify the read/write path to the file, to avoid the failure that results when you attempt to create a new file
2027 in a read-only volume. By convention, you indicate the read/write path by placing a period before the cell name at the
2028 pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). If you use the $MTPT variable
2029 in this field, the value in the <emphasis role="bold">V</emphasis> instruction's mount_point field possibly already
2030 indicates the read/write path. For further discussion of the concept of read/write and read-only paths through the
2031 filespace, see <link linkend="HDRWQ208">Mounting Volumes</link>.</para>
2033 <para>The Example Corporation example uses the value <emphasis role="bold">$MTPT/.login</emphasis> to place a file called
2034 <emphasis role="bold">.login</emphasis> in the user's home directory.</para>
2039 <term><emphasis role="bold">mode_bits</emphasis></term>
2042 <para>Defines the file's UNIX mode bits. Acceptable values are the standard three- or four-digit numbers corresponding
2043 to a combination of permissions. Examples: <emphasis role="bold">0755</emphasis> corresponds to <emphasis
2044 role="bold">rwxr-xr-x</emphasis>, and <emphasis role="bold">0644</emphasis> to <emphasis
2045 role="bold">rw-r--r--</emphasis>.</para>
2047 <para>The Example Corporation example uses the value <emphasis role="bold">0755</emphasis> to set the mode bits on the
2048 <emphasis role="bold">.login</emphasis> file to <emphasis role="bold">rwxr-xr-x</emphasis>.</para>
2053 <term><emphasis role="bold">owner</emphasis></term>
2056 <para>Specifies the username or UID of the user to be designated the file's owner in the output from the UNIX
2057 <emphasis role="bold">ls -l</emphasis> command.</para>
2059 <para>If the file resides in AFS, place the $UID variable in this field, as in the Example Corporation example template.
2060 The Protection Server then automatically assigns an AFS UID unless you provide the <emphasis
2061 role="bold">-uid</emphasis> argument to the <emphasis role="bold">uss add</emphasis> command or fill in the uid field
2062 in the bulk input file <emphasis role="bold">add</emphasis> instruction. (If you are converting existing UNIX
2063 accounts, see the discussion of additional considerations in <link linkend="HDRWQ459">Converting Existing UNIX
2064 Accounts with uss</link>.)</para>
2066 <para>If the file resides on the local disk, it is simplest to specify the username or UNIX UID under which you are
2067 issuing the <emphasis role="bold">uss</emphasis> command. For a discussion of the complications that arise from
2068 designating another user, see <link linkend="HDRWQ470">About Creating Local Disk Directories and Files</link>.</para>
2073 <term><emphasis role="bold">prototype_file</emphasis></term>
2076 <para>Names the AFS or local directory that houses the prototype file to copy. The prototype file's name must match
2077 the final element in the pathname field.</para>
2079 <para>The Example Corporation example references a prototype file called <emphasis role="bold">.login</emphasis> in the
2080 directory <emphasis role="bold">/afs/example.com/admin/user/proto</emphasis>.</para>
2083 </variablelist></para>
2086 <primary>uss commands</primary>
2088 <secondary>file, creating by echoing one line</secondary>
2092 <primary>creating</primary>
2094 <secondary>file with uss</secondary>
2098 <primary>file</primary>
2100 <secondary>creating with uss</secondary>
2104 <primary>uss template file</primary>
2106 <secondary>E instruction</secondary>
2110 <primary>uss template file</primary>
2112 <secondary>file</secondary>
2114 <tertiary>creating by echoing one line</tertiary>
2118 <primary>E instruction</primary>
2120 <secondary>uss template file</secondary>
2124 <sect2 id="HDRWQ476">
2125 <title>Creating One-Line Files with the E Instruction</title>
2127 <para>Each <emphasis role="bold">E</emphasis> instruction in the template file creates a file by echoing a specified single
2128 line into it; there is no limit on the number of them in the template. If an <emphasis role="bold">E</emphasis> instruction
2129 creates a file in a new user's home directory or a subdirectory of it (the intended use), then it must follow the <emphasis
2130 role="bold">V</emphasis> or <emphasis role="bold">D</emphasis> instruction that creates the parent directory. Creating a file
2131 on the local disk of the machine where the <emphasis role="bold">uss</emphasis> command runs is not recommended for the
2132 reasons detailed in <link linkend="HDRWQ470">About Creating Local Disk Directories and Files</link>.</para>
2134 <para>The <emphasis role="bold">F</emphasis> instruction also creates a file, but the two types of instruction have
2135 complementary advantages. Files created with an <emphasis role="bold">E</emphasis> instruction can be customized for each
2136 user, because variables can appear in the field that specifies the contents of the file. The command interpreter replaces the
2137 variables with appropriate values before creating the file. In contrast, the contents of a file created using the <emphasis
2138 role="bold">F</emphasis> instruction are the same for every user. An <emphasis role="bold">E</emphasis> file can be only a
2139 single line, however, whereas an <emphasis role="bold">F</emphasis> file can be any length.</para>
2141 <para>The <emphasis role="bold">E</emphasis> instruction is particularly suited to creating an entry for the new user in the
2142 cell's common source password file, which is then copied to client machines to serve as the local password file (<emphasis
2143 role="bold">/etc/passwd</emphasis> or equivalent). The following discussion of the fields refers to an example of this type of
2144 use, from the Example Corporation's full account template shown in <link linkend="HDRWQ471">Example uss Templates</link>. For
2145 further discussion of how to incorporate the files created in this way into a common source password file, see <link
2146 linkend="HDRWQ458">Creating a Common Source Password File</link>.</para>
2149 E /afs/.example.com/common/etc/newaccts/passwd_$USER 0644 root \
2150 "$USER:X:$UID:11:$NAME:$MTPT:/bin/csh"
2153 <para>The <emphasis role="bold">E</emphasis> instruction's syntax is as follows:</para>
2156 E pathname mode_bits owner "contents"
2159 <para>where <variablelist>
2161 <term><emphasis role="bold">E</emphasis></term>
2164 <para>Indicates a file creation instruction.</para>
2169 <term><emphasis role="bold">pathname</emphasis></term>
2172 <para>Specifies the full pathname of the file to create, including the filename. It can include variables. If it
2173 resides in the user's home directory or a subdirectory of it, it is simplest to use the $MTPT variable to specify the
2174 home directory pathname. When the $MTPT variable appears in an <emphasis role="bold">E</emphasis> instruction, it
2175 takes its value from the preceding <emphasis role="bold">V</emphasis> instruction's mount_point field (this dependency
2176 is why an <emphasis role="bold">E</emphasis> instruction must follow the <emphasis role="bold">V</emphasis>
2177 instruction.)</para>
2179 <para>Specify the read/write path to the file, to avoid the failure that results when you attempt to create a new file
2180 in a read-only volume. By convention, you indicate the read/write path by placing a period before the cell name at the
2181 pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). If you use the $MTPT variable
2182 in this field, the value in the <emphasis role="bold">V</emphasis> instruction's mount_point field possibly already
2183 indicates the read/write path. For further discussion of the concept of read/write and read-only paths through the
2184 filespace, see <link linkend="HDRWQ208">Mounting Volumes</link>.</para>
2186 <para>The Example Corporation example writes the file created by the <emphasis role="bold">E</emphasis> instruction to
2187 <emphasis role="bold">/afs/.example.com/common/etc/newaccts</emphasis> directory, naming it after the new user:</para>
2190 /afs/.example.com/common/etc/newaccts/passwd_$USER
2196 <term><emphasis role="bold">mode_bits</emphasis></term>
2199 <para>Defines the file's UNIX mode bits. Acceptable values are the standard three- or four-digit numbers corresponding
2200 to a combination of permissions. Examples: <emphasis role="bold">0755</emphasis> corresponds to <emphasis
2201 role="bold">rwxr-xr-x</emphasis>, and <emphasis role="bold">0644</emphasis> to <emphasis
2202 role="bold">rw-r--r--</emphasis>.</para>
2204 <para>The Example Corporation example uses the value <emphasis role="bold">0644</emphasis> to set the mode bits on the
2205 <emphasis role="bold">passwd_</emphasis>user file to <emphasis role="bold">r-xr--r--</emphasis>.</para>
2210 <term><emphasis role="bold">owner</emphasis></term>
2213 <para>Specifies the username or UID of the user to be designated the file's owner in the output from the UNIX
2214 <emphasis role="bold">ls -l</emphasis> command.</para>
2216 <para>If the file resides in AFS and is to be owned by the user, place the $UID variable in this field. The Protection
2217 Server then automatically assigns an AFS UID unless you provide the <emphasis role="bold">-uid</emphasis> argument to
2218 the <emphasis role="bold">uss add</emphasis> command or fill in the uid field in the bulk input file <emphasis
2219 role="bold">add</emphasis> instruction. (If you are converting existing UNIX accounts, see the discussion of
2220 additional considerations in <link linkend="HDRWQ459">Converting Existing UNIX Accounts with uss</link>.)</para>
2222 <para>If the file resides on the local disk, specify the username or UNIX UID under which you are issuing the
2223 <emphasis role="bold">uss</emphasis> command. For a discussion of the complications that arise from designating
2224 another user, see <link linkend="HDRWQ470">About Creating Local Disk Directories and Files</link>.</para>
2226 <para>The Example Corporation example is creating an AFS file intended for incorporation into the common password file,
2227 rather than for direct use by the new user. It therefore designates the local superuser <emphasis
2228 role="bold">root</emphasis> as the owner of the new file. Designating an alternate owner on an AFS file does not
2229 introduce complications: issuing the <emphasis role="bold">chown</emphasis> command on AFS files requires membership
2230 in the <emphasis role="bold">system:administrators</emphasis> group, but the issuer of the <emphasis
2231 role="bold">uss</emphasis> command is necessarily authenticated as a member of that group.</para>
2236 <term><emphasis role="bold">contents</emphasis></term>
2239 <para>Specifies the one-line character string to write into the new file. Surround it with double quotes if it
2240 contains one or more spaces. It cannot contain the newline character, but can contain any of the standard variables,
2241 which the command interpreter resolves as it creates the file.</para>
2243 <para>The Example Corporation example has the following value in the contents field, to create a password file
2247 $USER:X:$UID:10:$NAME:$MTPT:/bin/csh
2251 </variablelist></para>
2254 <primary>L instruction</primary>
2256 <secondary>uss template file</secondary>
2260 <primary>S instruction</primary>
2262 <secondary>uss template file</secondary>
2266 <primary>uss</primary>
2268 <secondary>hard link, creating</secondary>
2272 <primary>creating</primary>
2274 <secondary>link (hard or symbolic) with uss</secondary>
2278 <primary>hard link</primary>
2280 <secondary>creating with uss</secondary>
2284 <primary>uss template file</primary>
2286 <secondary>L instruction</secondary>
2290 <primary>uss template file</primary>
2292 <secondary>hard link, creating</secondary>
2296 <primary>uss</primary>
2298 <secondary>symbolic link, creating</secondary>
2302 <primary>symbolic link</primary>
2304 <secondary>creating with uss</secondary>
2308 <primary>uss template file</primary>
2310 <secondary>S instruction</secondary>
2314 <primary>uss template file</primary>
2316 <secondary>symbolic link, creating</secondary>
2320 <sect2 id="HDRWQ477">
2321 <title>Creating Links with the L and S Instructions</title>
2323 <para>Each <emphasis role="bold">L</emphasis> instruction in the template file creates a hard link between two files, as
2324 achieved by the standard UNIX <emphasis role="bold">ln</emphasis> command. The <emphasis role="bold">S</emphasis> instruction
2325 creates a symbolic link between two files, as achieved by the standard UNIX <emphasis role="bold">ln -s</emphasis> command. An
2326 explanation of links is beyond the scope of this document, but the basic effect in both cases is to create a second name for
2327 an existing file, so that it can be accessed via either name. Creating a link does not create a second copy of the
2330 <para>There is no limit on the number of <emphasis role="bold">L</emphasis> or <emphasis role="bold">S</emphasis> instructions
2331 in a template file. If the link is in a new user's home directory or a subdirectory of it (the intended use), then it must
2332 follow the <emphasis role="bold">V</emphasis> or <emphasis role="bold">D</emphasis> instruction that creates the parent
2333 directory, and the <emphasis role="bold">F</emphasis>, <emphasis role="bold">E</emphasis>, or <emphasis
2334 role="bold">X</emphasis> instruction that creates the file being linked to. Creating a file on the local disk of the machine
2335 where the <emphasis role="bold">uss</emphasis> command runs is not recommended, for the reasons detailed in <link
2336 linkend="HDRWQ470">About Creating Local Disk Directories and Files</link>.</para>
2338 <para>Note that AFS allows hard links only between files that reside in the same directory. This restriction is necessary to
2339 eliminate the confusion that results from associating two potentially different ACLs (those of the two directories) with the
2340 same file. Symbolic links are legal between two files that reside in different directories and even in different volumes. The
2341 ACL on the actual file applies to the link as well.</para>
2343 <para>You do not set the owner or mode bits on a link created with an <emphasis role="bold">L</emphasis> or <emphasis
2344 role="bold">S</emphasis> instruction, as you do for directories or files. The <emphasis role="bold">uss</emphasis> command
2345 interpreter automatically records the UNIX UID of the <emphasis role="bold">uss</emphasis> command's issuer as the owner, and
2346 sets the mode bits to <emphasis role="bold">lrwxrwxrwx</emphasis> (777).</para>
2348 <para>The following discussion of the fields in an <emphasis role="bold">L</emphasis> or <emphasis role="bold">S</emphasis>
2349 instruction refers to an example in the full account template from <link linkend="HDRWQ471">Example uss Templates</link>,
2353 S /afs/example.com/public/$USER $MTPT/public
2356 <para>The <emphasis role="bold">L</emphasis> and <emphasis role="bold">S</emphasis> instructions' syntax is as follows:</para>
2359 L existing_file link
2360 S existing_file link
2363 <para>where <variablelist>
2365 <term><emphasis role="bold">L</emphasis></term>
2368 <para>Indicates a hard link creation instruction.</para>
2373 <term><emphasis role="bold">S</emphasis></term>
2376 <para>Indicates a symbolic link creation instruction.</para>
2381 <term><emphasis role="bold">existing_file</emphasis></term>
2384 <para>Specifies the complete pathname of the existing file. If it resides in the user's home directory or a
2385 subdirectory of it, it is simplest to use the $MTPT variable to specify the home directory pathname. When the $MTPT
2386 variable appears in an <emphasis role="bold">L</emphasis> or <emphasis role="bold">S</emphasis> instruction, it takes
2387 its value from the preceding <emphasis role="bold">V</emphasis> instruction's mount_point field (this dependency is
2388 why the instruction must follow the <emphasis role="bold">V</emphasis> instruction).</para>
2390 <para>Do not create a symbolic link to a file whose name begins with the number sign (<emphasis
2391 role="bold">#</emphasis>) or percent sign (<emphasis role="bold">%</emphasis>). When the Cache Manager reads a
2392 symbolic link whose contents begin with one of those characters, it interprets it as a regular or read/write mount
2393 point, respectively.</para>
2395 <para>The Example Corporation example creates a link to the publicly readable volume created and mounted by a preceding
2396 <emphasis role="bold">X</emphasis> instruction, by specifying the path to its mount point:</para>
2399 /afs/example.com/public/$USER
2405 <term><emphasis role="bold">link</emphasis></term>
2408 <para>Specifies the complete pathname of the second name for the file. If it resides in the user's home directory or a
2409 subdirectory of it, it is simplest to use the $MTPT variable to specify the home directory pathname.</para>
2411 <para>Specify the read/write path to the link, to avoid the failure that results when you attempt to create a new link
2412 in a read-only volume. By convention, you indicate the read/write path by placing a period before the cell name at the
2413 pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). If you use the $MTPT variable
2414 in this field, the value in the <emphasis role="bold">V</emphasis> instruction's mount_point field possibly already
2415 indicates the read/write path. For further discussion of the concept of read/write and read-only paths through the
2416 filespace, see <link linkend="HDRWQ208">Mounting Volumes</link>.</para>
2418 <para>The Example Corporation example creates a link called <emphasis role="bold">public</emphasis> in the user's home
2426 </variablelist></para>
2429 <primary>A instruction</primary>
2431 <secondary>uss template file</secondary>
2435 <primary>uss commands</primary>
2437 <secondary>password/authentication security, setting with A instruction</secondary>
2441 <primary>uss template file</primary>
2443 <secondary>A instruction</secondary>
2447 <primary>uss template file</primary>
2449 <secondary>password/authentication security, setting with A instruction</secondary>
2453 <sect2 id="HDRWQ478">
2454 <title>Increasing Account Security with the A Instruction</title>
2456 <para>The <emphasis role="bold">A</emphasis> instruction in the template file enhances cell security by imposing the following
2457 restrictions on users' password choice and authentication attempts. <itemizedlist>
2459 <para>Limiting the user's password lifetime. When the lifetime expires, the user can no longer use the password to
2460 authenticate and must change it.</para>
2464 <para>Prohibiting the reuse of the user's 20 most-recently used passwords.</para>
2468 <para>Limiting the number of consecutive times that a user can provide an incorrect password during authentication, and
2469 for how long the Authentication Server refuses further authentication attempts after the limit is exceeded (referred to
2470 as an <emphasis>account lockout</emphasis>). For regular user accounts in most cells, the recommended limit is nine and
2471 lockout time is 25 minutes.</para>
2473 </itemizedlist></para>
2475 <para>The following discussion of the fields in an <emphasis role="bold">A</emphasis> instruction refers to the example in the
2476 full account template from <link linkend="HDRWQ471">Example uss Templates</link>, which sets a password lifetime of 250 days,
2477 prohibits reuse of passwords, limits the number of failed authentication attempts to nine, and creates a lockout time of 25
2478 minutes if the authentication limit is exceeded:</para>
2481 A $USER 250 noreuse 9 25
2484 <para>The <emphasis role="bold">A</emphasis> instruction's syntax is as follows:</para>
2487 A username password_lifetime password_reuse failures locktime
2490 <para>where <variablelist>
2492 <term><emphasis role="bold">A</emphasis></term>
2495 <para>Indicates a security enhancing instruction.</para>
2500 <term><emphasis role="bold">username</emphasis></term>
2503 <para>Names the Authentication Database entry on which to impose security restrictions. Use the $USER variable to read
2504 in the username from the <emphasis role="bold">uss add</emphasis> command's <emphasis role="bold">-user</emphasis>
2505 argument, or from the username field of an <emphasis role="bold">add</emphasis> instruction in the bulk input file.
2506 The Example Corporation example uses this value.</para>
2511 <term><emphasis role="bold">password_lifetime</emphasis></term>
2514 <para>Sets the number of days after the user's password is changed that it remains valid. When the password becomes
2515 invalid (expires), the user is unable to authenticate, but has 30 more days in which to issue the <emphasis
2516 role="bold">kpasswd</emphasis> command to change the password (after that, only an administrator can change
2519 <para>Specify an integer from the range <emphasis role="bold">1</emphasis> through <emphasis
2520 role="bold">254</emphasis> to specify the number of days until expiration, the value <emphasis
2521 role="bold">0</emphasis> to indicate that the password never expires, or the value $PWEXPIRES to read in the number of
2522 days from the <emphasis role="bold">uss add</emphasis> or <emphasis role="bold">uss bulk</emphasis> command's
2523 <emphasis role="bold">-pwexpires</emphasis> argument. If the <emphasis role="bold">A</emphasis> instruction does not
2524 appear in the template file, by default the user's password never expires.</para>
2526 <para>The Example Corporation example sets a password lifetime of 250 days.</para>
2531 <term><emphasis role="bold">password_reuse</emphasis></term>
2534 <para>Determines whether or not the user can change his or her password (using the <emphasis
2535 role="bold">kpasswd</emphasis> or <emphasis role="bold">kas setpassword</emphasis> command) to one that is similar to
2536 any of his or her last 20 passwords. The acceptable values are <emphasis role="bold">reuse</emphasis> to allow reuse
2537 and <emphasis role="bold">noreuse</emphasis> to prohibit it. If the <emphasis role="bold">A</emphasis> instruction
2538 does not appear in the template file, the default is to allow password reuse.</para>
2540 <para>The Example Corporation example prohibits password reuse.</para>
2545 <term><emphasis role="bold">failures</emphasis></term>
2548 <para>Sets the number of consecutive times the user can provide an incorrect password during authentication (using the
2549 <emphasis role="bold">klog</emphasis> command or a login utility that grants AFS tokens). When the user exceeds the
2550 limit, the Authentication Server rejects further authentication attempts for the amount of time specified in the
2551 locktime field.</para>
2553 <para>Specify an integer from the range <emphasis role="bold">1</emphasis> through <emphasis
2554 role="bold">254</emphasis> to specify the number of failures permitted, or the value <emphasis
2555 role="bold">0</emphasis> to indicate that there is no limit to the number of unsuccessful attempts. If the <emphasis
2556 role="bold">A</emphasis> instruction does not appear in the template file, the default is to allow an unlimited number
2559 <para>The Example Corporation example sets the limit to nine failed attempts.</para>
2564 <term><emphasis role="bold">locktime</emphasis></term>
2567 <para>Specifies how long the Authentication Server refuses authentication attempts from a user who has exceeded the
2568 failure limit set in the failures field.</para>
2570 <para>Specify a number of hours and minutes (hh:mm) or minutes only (mm), from the range <emphasis
2571 role="bold">01</emphasis> (one minute) through <emphasis role="bold">36:00</emphasis> (36 hours). The Authentication
2572 Server automatically reduces any larger value to <emphasis role="bold">36:00</emphasis> and also rounds up any nonzero
2573 value to the next highest multiple of 8.5 minutes. A value of <emphasis role="bold">0</emphasis> (zero) sets an
2574 infinite lockout time, in which case an administrator must always issue the <emphasis role="bold">kas
2575 unlock</emphasis> command to unlock the account.</para>
2577 <para>The Example Corporation example sets the lockout time to 25 minutes, which is rounded up to 25 minutes 30 seconds
2578 (the next highest multiple of 8.5 minutes).</para>
2581 </variablelist></para>
2584 <primary>uss commands</primary>
2586 <secondary>command, executing with X instruction</secondary>
2590 <primary>executing</primary>
2592 <secondary>command using uss template line</secondary>
2596 <primary>commands</primary>
2598 <secondary>executing from uss template file</secondary>
2602 <primary>uss template file</primary>
2604 <secondary>X instruction</secondary>
2608 <primary>uss template file</primary>
2610 <secondary>command, executing with X instruction</secondary>
2614 <primary>X instruction</primary>
2616 <secondary>uss template file</secondary>
2620 <sect2 id="HDRWQ479">
2621 <title>Executing Commands with the X Instruction</title>
2623 <para>The <emphasis role="bold">X</emphasis> instruction in the template file executes a command, which can be a standard UNIX
2624 command, a shell script or program, or an AFS command. The command string can include standard template variables, and any
2625 number of <emphasis role="bold">X</emphasis> instructions can appear in a template file. If an instruction manipulates an
2626 element created by another instruction, it must appear after that instruction.</para>
2628 <para>The following discussion of the field in an <emphasis role="bold">X</emphasis> instruction refers to the example in the
2629 full account template from <link linkend="HDRWQ471">Example uss Templates</link>:</para>
2632 X "create_public_vol $USER $1 $2"
2635 <para>The <emphasis role="bold">X</emphasis> instruction's syntax is as follows:</para>
2641 <para>where command specifies the command to execute. Surround it with double quotes if it contains spaces. The command string
2642 can contain any of the standard variables, which the <emphasis role="bold">uss</emphasis> command interpreter resolves before
2643 passing the command on to the appropriate other command interpreter, but it cannot contain newline characters.</para>
2645 <para>The Example Corporation example invokes a script called <emphasis role="bold">create_public_vol</emphasis>, which creates
2646 another volume associated with the new user and mounts it in a publicly readable part of the Example Corporation's
2650 "create_public_vol $USER $1 $2"
2653 <para>It uses the $USER variable to read in the username and make it part of both the volume name and mount point name. The
2654 <emphasis role="bold">uss</emphasis> command issuer supplies a file server machine name for the $1 variable and a partition
2655 name for the $2 variable, to specify the site for the new volume. <indexterm>
2656 <primary>creating</primary>
2658 <secondary>user account</secondary>
2660 <tertiary>with uss</tertiary>
2661 </indexterm> <indexterm>
2662 <primary>user</primary>
2664 <secondary>account</secondary>
2666 <see>user account</see>
2667 </indexterm> <indexterm>
2668 <primary>user account</primary>
2670 <secondary>creating</secondary>
2672 <tertiary>with uss</tertiary>
2673 </indexterm> <indexterm>
2674 <primary>username</primary>
2676 <secondary>assigning</secondary>
2678 <tertiary>with uss</tertiary>
2679 </indexterm> <indexterm>
2680 <primary>creating</primary>
2682 <secondary>Protection Database user entry</secondary>
2684 <tertiary>with uss</tertiary>
2685 </indexterm> <indexterm>
2686 <primary>creating</primary>
2688 <secondary>Authentication Database entry</secondary>
2690 <tertiary>with uss</tertiary>
2691 </indexterm> <indexterm>
2692 <primary>Protection Database</primary>
2694 <secondary>user entry</secondary>
2696 <tertiary>creating with uss</tertiary>
2697 </indexterm> <indexterm>
2698 <primary>Authentication Database</primary>
2700 <secondary>entry</secondary>
2702 <tertiary>creating with uss</tertiary>
2703 </indexterm> <indexterm>
2704 <primary>uss commands</primary>
2706 <secondary>creating individual user account</secondary>
2707 </indexterm> <indexterm>
2708 <primary>AFS UID</primary>
2710 <secondary>assigning</secondary>
2712 <tertiary>with uss</tertiary>
2713 </indexterm> <indexterm>
2714 <primary>user</primary>
2716 <secondary>AFS UID, assigning</secondary>
2721 <sect1 id="HDRWQ480">
2722 <title>Creating Individual Accounts with the uss add Command</title>
2724 <para>After you have created a template file, you can create an individual account by issuing the <emphasis role="bold">uss
2725 add</emphasis> command (for template creation instructions see <link linkend="HDRWQ463">Constructing a uss Template
2726 File</link>). When you issue the command, the <emphasis role="bold">uss</emphasis> command interpreter contacts various AFS
2727 servers to perform the following actions: <itemizedlist>
2729 <para>Create a Protection Database entry. By default, the Protection Server assigns an AFS UID which becomes the value of
2730 the $UID variable used in the template.</para>
2734 <para>Create an Authentication Database entry, recording an encrypted version of the initial password.</para>
2738 <para>Create the account components defined in the indicated template file, contacting the File Server, Volume Server, and
2739 Volume Location (VL) Server as necessary.</para>
2741 </itemizedlist></para>
2743 <para>To review which types of instructions to include in a template to create different file system objects, see <link
2744 linkend="HDRWQ463">Constructing a uss Template File</link>. If the template is empty, the <emphasis role="bold">uss
2745 add</emphasis> command creates an authentication-only account consisting of Protection Database and Authentication Database
2748 <para>When you issue the <emphasis role="bold">uss add</emphasis> command, provide a value for each variable in the template
2749 file by including the corresponding command-line argument. If you fail to supply a value for a variable, the <emphasis
2750 role="bold">uss</emphasis> command interpreter substitutes a null string, which usually causes the account creation to fail. If
2751 you include a command line argument for which the corresponding variable does not appear in the template, it is ignored.</para>
2753 <para><link linkend="TBLWQ481">Table 4</link> summarizes the mappings between variables and the arguments to the <emphasis
2754 role="bold">uss add</emphasis> command. It is adapted from <link linkend="TBLWQ466">Table 3</link>, but includes only those
2755 variables that take their value from command line arguments.</para>
2757 <table id="TBLWQ481" label="4">
2758 <title>Command-line argument sources for uss template variables</title>
2761 <colspec colwidth="20*" />
2763 <colspec colwidth="80*" />
2767 <entry><emphasis role="bold">Variable</emphasis></entry>
2769 <entry><emphasis role="bold">Command-line Argument</emphasis></entry>
2775 <entry>$MTPT</entry>
2777 <entry><emphasis role="bold">-mount</emphasis> (for occurrence in <emphasis role="bold">V</emphasis>
2778 instruction)</entry>
2782 <entry>$NAME</entry>
2784 <entry><emphasis role="bold">-realname</emphasis> if provided; otherwise <emphasis role="bold">-user</emphasis></entry>
2788 <entry>$PART</entry>
2790 <entry><emphasis role="bold">-partition</emphasis></entry>
2794 <entry>$PWEXPIRES</entry>
2796 <entry><emphasis role="bold">-pwexpires</emphasis></entry>
2800 <entry>$SERVER</entry>
2802 <entry><emphasis role="bold">-server</emphasis></entry>
2808 <entry><emphasis role="bold">-uid</emphasis> if provided; otherwise allocated by Protection Server</entry>
2812 <entry>$USER</entry>
2814 <entry><emphasis role="bold">-user</emphasis></entry>
2818 <entry>$1 through $9</entry>
2820 <entry><emphasis role="bold">-var</emphasis></entry>
2826 <sect2 id="HDRWQ483">
2827 <title>To create an AFS account with the uss add command</title>
2831 <para>Authenticate as an AFS identity with all of the following privileges. In the conventional configuration, the
2832 <emphasis role="bold">admin</emphasis> user account has them, or you possibly have a personal administrative account. (To
2833 increase cell security, it is best to create special privileged accounts for use only while performing administrative
2834 procedures; for further discussion, see <link linkend="HDRWQ584">An Overview of Administrative Privilege</link>.) If
2835 necessary, issue the <emphasis role="bold">klog</emphasis> command to authenticate. <programlisting>
2836 % <emphasis role="bold">klog</emphasis> admin_user
2837 Password: <<replaceable>admin_password</replaceable>>
2838 </programlisting></para>
2840 <para>The following list specifies the necessary privileges and indicates how to check that you have them.</para>
2844 <para>Membership in the <emphasis role="bold">system:administrators</emphasis> group. If necessary, issue the
2845 <emphasis role="bold">pts membership</emphasis> command, which is fully described in <link linkend="HDRWQ587">To
2846 display the members of the system:administrators group</link>. <programlisting>
2847 % <emphasis role="bold">pts membership system:administrators</emphasis>
2848 </programlisting></para>
2852 <para>Inclusion in the <emphasis role="bold">/usr/afs/etc/UserList</emphasis> file. If necessary, issue the <emphasis
2853 role="bold">bos listusers</emphasis> command, which is fully described in <link linkend="HDRWQ593">To display the
2854 users in the UserList file</link>. <programlisting>
2855 % <emphasis role="bold">bos listusers</emphasis> <<replaceable>machine name</replaceable>>
2856 </programlisting></para>
2860 <para>The <computeroutput>ADMIN</computeroutput> flag on the Authentication Database entry. However, the
2861 Authentication Server always prompts you for a password in order to perform its own authentication. The following
2862 instructions direct you to specify the administrative identity on the <emphasis role="bold">uss</emphasis> command
2867 <para>The <emphasis role="bold">i</emphasis> (<emphasis role="bold">insert</emphasis>) and <emphasis
2868 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permissions on the ACL of the directory in which
2869 you are mounting the user's volume. If necessary, issue the <emphasis role="bold">fs listacl</emphasis> command, which
2870 is fully described in <link linkend="HDRWQ572">Displaying ACLs</link>. <programlisting>
2871 % <emphasis role="bold">fs listacl</emphasis> [<<replaceable>dir/file path</replaceable>>]
2872 </programlisting></para>
2874 <para>Members of the <emphasis role="bold">system:administrators</emphasis> group always implicitly have the <emphasis
2875 role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) and by default also the <emphasis
2876 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission on every ACL and can use the <emphasis
2877 role="bold">fs setacl</emphasis> command to grant other rights as necessary.</para>
2883 <para><emphasis role="bold">(Optional)</emphasis> Log in as the local superuser <emphasis role="bold">root</emphasis>.
2884 This is necessary only if you are creating new files or directories in the local file system and want to designate an
2885 alternate owner as the object is created. For a discussion of the issues involved, see <link linkend="HDRWQ470">About
2886 Creating Local Disk Directories and Files</link>.</para>
2890 <para>Verify the location and functionality of the template file you are using. For a description of where the <emphasis
2891 role="bold">uss</emphasis> command interpreter expects to find the template, see <link linkend="HDRWQ468">Where to Place
2892 Template Files</link>. You can always provide an alternate pathname if you wish. Also note the variables used in the
2893 template, to be sure that you provide the corresponding arguments on the <emphasis role="bold">uss</emphasis> command
2898 <para><emphasis role="bold">(Optional)</emphasis> Change to the directory where the template
2899 resides. This affects the type of pathname you must type in Step <link linkend="LIWQ485">6</link>. <programlisting>
2900 % <emphasis role="bold">cd</emphasis> template_directory
2901 </programlisting></para>
2905 <para><emphasis role="bold">(Optional)</emphasis> Run the <emphasis role="bold">uss add</emphasis> command with the
2906 <emphasis role="bold">-dryrun</emphasis> flag to preview the creation of the account. Note any error messages and correct
2907 the cause before reissuing the command without the <emphasis role="bold">-dryrun</emphasis> flag. The next step describes
2908 the <emphasis role="bold">uss add</emphasis> command's syntax. For more information on the <emphasis
2909 role="bold">-dryrun</emphasis> flag, see <link linkend="HDRWQ454">Avoiding and Recovering from Errors and Interrupted
2910 Operations</link>. <indexterm>
2911 <primary>uss commands</primary>
2913 <secondary>add</secondary>
2914 </indexterm><indexterm>
2915 <primary>commands</primary>
2917 <secondary>uss add</secondary>
2921 <listitem id="LIWQ485">
2922 <para>Issue the <emphasis role="bold">uss add</emphasis> command to create the account. Enter the
2923 command on a single line; it appears here on multiple lines only for legibility.</para>
2925 <para>The <emphasis role="bold">uss add</emphasis> operation creates an Authentication Database entry. The Authentication
2926 Server performs its own authentication rather than accepting your existing AFS token. By default, it authenticates your
2927 local (UNIX) identity, which possibly does not correspond to an AFS-privileged administrator. Include the <emphasis
2928 role="bold">-admin</emphasis> argument to name an identity that has the <computeroutput>ADMIN</computeroutput> flag on its
2929 Authentication Database entry. To verify that an entry has the flag, issue the <emphasis role="bold">kas
2930 examine</emphasis> command as described in <link linkend="HDRWQ590">To check if the ADMIN flag is set</link>.</para>
2933 % <emphasis role="bold">uss add</emphasis> <emphasis role="bold">-user</emphasis> <<replaceable>login name</replaceable>> <emphasis
2934 role="bold">-admin</emphasis> <<replaceable>administrator to authenticate</replaceable>> \
2935 [<emphasis role="bold">-realname</emphasis> <<replaceable>full name in quotes</replaceable>>] [<emphasis
2936 role="bold">-pass</emphasis> <<replaceable>initial passwd</replaceable>>] \
2937 [<emphasis role="bold">-pwexpires</emphasis> <<replaceable>password expires in [0..254] days (0 =</replaceable>> never)>] \
2938 [<emphasis role="bold">-server</emphasis> <<replaceable>FileServer for home volume</replaceable>>] \
2939 [<emphasis role="bold">-partition</emphasis> <<replaceable>FileServer's disk partition for home volume</replaceable>>] \
2940 [<emphasis role="bold">-mount</emphasis> <<replaceable>home directory mount point</replaceable>>] \
2941 [<emphasis role="bold">-uid</emphasis> <<replaceable>uid to assign the user</replaceable>>] \
2942 [<emphasis role="bold">-template</emphasis> <<replaceable>pathname of template file</replaceable>>] \
2943 [<emphasis role="bold">-var</emphasis> <<replaceable>auxiliary argument pairs (Numval)</replaceable>>+] [<emphasis
2944 role="bold">-dryrun</emphasis>] \
2945 [<emphasis role="bold">-overwrite</emphasis>]
2946 Administrator's (admin_user) password: <<replaceable>admin_password</replaceable>>
2949 <para>where <variablelist>
2951 <term><emphasis role="bold">ad</emphasis></term>
2954 <para>Is the shortest acceptable abbreviation of <emphasis role="bold">add</emphasis>.</para>
2959 <term><emphasis role="bold">-user</emphasis></term>
2962 <para>Names the user's Authentication Database and Protection Database entries. Because it becomes the username
2963 (the name under which a user logs in), it must obey the restrictions that many operating systems impose on
2964 usernames (usually, to contain no more than eight lowercase letters). Also avoid the following characters: colon
2965 (<emphasis role="bold">:</emphasis>), semicolon (<emphasis role="bold">;</emphasis>), comma (<emphasis
2966 role="bold">,</emphasis>), at sign (<emphasis role="bold">@</emphasis>), space, newline, and the period (<emphasis
2967 role="bold">.</emphasis>), which is conventionally used only in special administrative names.</para>
2969 <para>This argument provides the value for the $USER variable in the template file. For suggestions on
2970 standardizing usernames, see <link linkend="HDRWQ58">Choosing Usernames and Naming Other Account
2971 Components</link>.</para>
2976 <term><emphasis role="bold">-admin</emphasis></term>
2979 <para>Names an administrative account that has the <computeroutput>ADMIN</computeroutput> flag on its
2980 Authentication Database entry, such as <emphasis role="bold">admin</emphasis>. The password prompt echoes it as
2981 admin_user. Enter the appropriate password as admin_password.</para>
2986 <term><emphasis role="bold">-realname</emphasis></term>
2989 <para>Specifies the user's actual full name. If it contains spaces or punctuation, surround it with double quotes.
2990 If you do not provide it, it defaults to the username provided with the <emphasis role="bold">-user</emphasis>
2993 <para>This argument provides the value for the $NAME variable in the template file. For information about using
2994 this argument and variable as part of an automated process for creating entries in a local password file such as
2995 <emphasis role="bold">/etc/passwd</emphasis>, see <link linkend="HDRWQ458">Creating a Common Source Password
3001 <term><emphasis role="bold">-pass</emphasis></term>
3004 <para>Specifies the user's initial password. Although the AFS commands that handle passwords accept strings of
3005 virtually unlimited length, it is best to use a password of eight characters or less, which is the maximum length
3006 that many applications and utilities accept.</para>
3008 <para>Possible choices for initial passwords include the username, a string of digits such as those from a Social
3009 Security number, or a standard string such as <emphasis role="bold">changeme</emphasis>, which is the default if
3010 you do not provide this argument. There is no corresponding variable in the template file.</para>
3012 <para>Instruct users to change their passwords to a truly secret string as soon as they authenticate with AFS for
3013 the first time. The <emphasis>OpenAFS User Guide</emphasis> explains how to use the <emphasis
3014 role="bold">kpasswd</emphasis> command to change an AFS password.</para>
3019 <term><emphasis role="bold">-pwexpires</emphasis></term>
3022 <para>Sets the number of days after a user's password is changed that it remains valid. Provide an integer from
3023 the range <emphasis role="bold">1</emphasis> through <emphasis role="bold">254</emphasis> to specify the number of
3024 days until expiration, or the value <emphasis role="bold">0</emphasis> to indicate that the password never expires
3025 (the default if you do not provide this argument). When the password becomes invalid (expires), the user is unable
3026 to authenticate, but has 30 more days in which to issue the <emphasis role="bold">kpasswd</emphasis> command to
3027 change the password; after that, only an administrator can change it.</para>
3029 <para>This argument provides the value for the $PWEXPIRES variable in the template file.</para>
3034 <term><emphasis role="bold">-server</emphasis></term>
3037 <para>Names the file server machine on which to create the new user's home volume. It is best to provide a fully
3038 qualified hostname (for example, <emphasis role="bold">fs1.example.com</emphasis>), but an abbreviated form is
3039 acceptable provided that the cell's naming service is available to resolve it when you issue the <emphasis
3040 role="bold">uss add</emphasis> command.</para>
3042 <para>This argument provides the value for the $SERVER variable in the template file. To avoid having to type a
3043 fully qualified hostname on the command line, combine the $SERVER variable with a constant (for example, the
3044 cell's domain name) in the server field of the <emphasis role="bold">V</emphasis> instruction in the template
3045 file. For an example, see <link linkend="HDRWQ473">Creating a Volume with the V Instruction</link>.</para>
3050 <term><emphasis role="bold">-partition</emphasis></term>
3053 <para>Specifies the partition on which to create the user's home volume; it must be on the file server machine
3054 named by the <emphasis role="bold">-server</emphasis> argument. Identify the partition by its complete name (for
3055 example, <emphasis role="bold">/vicepa</emphasis>), or use one of the abbreviations listed in <link
3056 linkend="HDRWQ615">Rules for Using Abbreviations and Aliases</link>.</para>
3058 <para>This argument provides the value for the $PART variable in the template file.</para>
3063 <term><emphasis role="bold">-mount</emphasis></term>
3066 <para>Specifies the pathname for the user's home directory in the cell's read/write filespace. Partial pathnames
3067 are interpreted relative to the current working directory.</para>
3069 <para>This argument provides the value for the $MTPT variable in the template file, but only when it appears in
3070 the <emphasis role="bold">V</emphasis> instruction's mount_point field. When the $MTPT variable appears in any
3071 subsequent instructions, it takes its value from the <emphasis role="bold">V</emphasis> instruction's mount_point
3072 field, rather than directly from this argument. For more details, and for suggestions about how to use this
3073 argument and the $MTPT variable, see <link linkend="HDRWQ473">Creating a Volume with the V
3074 Instruction</link>.</para>
3079 <term><emphasis role="bold">-uid</emphasis></term>
3082 <para>Specifies a positive integer other than <emphasis role="bold">0</emphasis> (zero) to assign as the user's
3083 AFS UID. It is best to omit this argument and allow the Protection Server to assign an AFS UID that is one greater
3084 than the current value of the <computeroutput>max user id</computeroutput> counter. (To display the counter, use
3085 the <emphasis role="bold">pts listmax</emphasis> command as described in <link linkend="HDRWQ561">To display the
3086 AFS ID counters</link>.)</para>
3088 <para>If you have a reason to use this argument (perhaps because the user already has a UNIX UID), first use the
3089 <emphasis role="bold">pts examine</emphasis> command to verify that there is no existing account with the desired
3090 AFS UID; if there is, the account creation process terminates with an error.</para>
3092 <para>This argument provides the value for the $UID variable in the template file.</para>
3097 <term><emphasis role="bold">-template</emphasis></term>
3100 <para>Specifies the pathname of the template file. If you omit this argument, the command interpreter searches for
3101 a template file called <emphasis role="bold">uss.template</emphasis> in each of the following directories in turn:
3104 <para>The current working directory</para>
3108 <para><emphasis role="bold">/afs/</emphasis>cellname<emphasis role="bold">/common/uss</emphasis>, where
3109 cellname names the local cell</para>
3113 <para><emphasis role="bold">/etc</emphasis></para>
3115 </orderedlist></para>
3117 <para>If you specify a filename other than <emphasis role="bold">uss.template</emphasis> but without a pathname,
3118 the command interpreter searches for it in the indicated directories. If you provide a full or partial pathname,
3119 the command interpreter consults the specified file only; it interprets partial pathnames relative to the current
3120 working directory.</para>
3122 <para>If the specified template file is empty (zero-length), the command creates Protection and Authentication
3123 Database entries only.</para>
3125 <para>To learn how to construct a template file, see <link linkend="HDRWQ463">Constructing a uss Template
3131 <term><emphasis role="bold">-var</emphasis></term>
3134 <para>Specifies values for each of the number variables $1 through $9 that can appear in the template file. You
3135 can use the number variables to assign values to variables in the <emphasis role="bold">uss</emphasis> template
3136 file that are not part of the standard set.</para>
3138 <para>For each instance of this argument, provide two parts in the indicated order, separated by a space:
3141 <para>The integer from the range <emphasis role="bold">1</emphasis> through <emphasis
3142 role="bold">9</emphasis> that matches the variable in the template file. Do not precede it with a dollar
3147 <para>A string of alphanumeric characters to assign as the value of the variable.</para>
3149 </itemizedlist></para>
3151 <para>To learn about suggested uses for the number variables, see the description of the <emphasis
3152 role="bold">V</emphasis> instruction's quota field in <link linkend="HDRWQ473">Creating a Volume with the V
3153 Instruction</link>.</para>
3158 <term><emphasis role="bold">-dryrun</emphasis></term>
3161 <para>Reports actions that the command interpreter needs to perform to run the command, without actually
3162 performing them.</para>
3167 <term><emphasis role="bold">-overwrite</emphasis></term>
3170 <para>Overwrites any directories, files, and links that exist in the file system and for which there are
3171 definitions in <emphasis role="bold">D</emphasis>, <emphasis role="bold">E</emphasis>, <emphasis
3172 role="bold">F</emphasis>, <emphasis role="bold">L</emphasis>, or <emphasis role="bold">S</emphasis> instructions
3173 in the template file named by the <emphasis role="bold">-template</emphasis> argument. If you omit this flag, the
3174 command interpreter prompts you once for confirmation that you want to overwrite all such elements.</para>
3177 </variablelist></para>
3181 <para>If the new user home directory resides in a replicated volume, use the <emphasis role="bold">vos release</emphasis>
3182 command to release the volume, as described in <link linkend="HDRWQ194">To replicate a read/write volume (create a
3183 read-only volume)</link>. <programlisting>
3184 % <emphasis role="bold">vos release</emphasis> <<replaceable>volume name or ID</replaceable>>
3185 </programlisting></para>
3188 <para>This step can be necessary even if the home directory's parent directory is not itself a mount point for a
3189 replicated volume (and is easier to overlook in that case). For example, the Example Corporation template puts the mount
3190 points for user volumes in the <emphasis role="bold">/afs/example.com/usr</emphasis> directory. Because that is a regular
3191 directory rather than a mount point, it resides in the <emphasis role="bold">root.cell</emphasis> volume mounted at the
3192 <emphasis role="bold">/afs/example.com</emphasis> directory. That volume is replicated, so after changing it by creating a
3193 new mount point the administrator must issue the <emphasis role="bold">vos release</emphasis> command.</para>
3198 <para>Create an entry for the new user in the local password file (<emphasis role="bold">/etc/passwd</emphasis> or
3199 equivalent) on each AFS client machine that he or she can log into. For suggestions on automating this step, see <link
3200 linkend="HDRWQ458">Creating a Common Source Password File</link>.</para>
3202 <para>Even if you do not use the automated method, set the user's UNIX UID to match the AFS UID assigned automatically by
3203 the Protection Server or assigned with the <emphasis role="bold">-uid</emphasis> argument. The new user's AFS UID appears
3204 in the trace produced by the <emphasis role="bold">uss add</emphasis> output, or you can use the <emphasis role="bold">pts
3205 examine</emphasis> command to display it, as described in <link linkend="HDRWQ537">To display a Protection Database
3206 entry</link>.</para>
3211 <primary>deleting</primary>
3213 <secondary>user accounts with uss</secondary>
3217 <primary>user account</primary>
3219 <secondary>deleting with uss</secondary>
3223 <primary>deleting</primary>
3225 <secondary>Protection Database user entry with uss</secondary>
3229 <primary>deleting</primary>
3231 <secondary>Authentication Database entry with uss</secondary>
3235 <primary>Protection Database</primary>
3237 <secondary>user entry</secondary>
3239 <tertiary>deleting with uss</tertiary>
3243 <primary>Authentication Database</primary>
3245 <secondary>entry</secondary>
3247 <tertiary>deleting with uss</tertiary>
3251 <primary>uss commands</primary>
3253 <secondary>deleting individual user account</secondary>
3258 <sect1 id="HDRWQ486">
3259 <title>Deleting Individual Accounts with the uss delete Command</title>
3261 <para>The <emphasis role="bold">uss delete</emphasis> command deletes an AFS user account according to the arguments you provide
3262 on the command line; unlike the <emphasis role="bold">uss add</emphasis> command, it does not use a template file. When you
3263 issue the command, the <emphasis role="bold">uss</emphasis> command interpreter contacts various AFS servers to perform the
3264 following actions: <itemizedlist>
3266 <para>Remove the mount point for the user's home volume</para>
3270 <para>Remove the user's home volume and delete the associated VLDB entry, unless you include the <emphasis
3271 role="bold">-savevolume</emphasis> flag</para>
3275 <para>Delete the user's Authentication Database entry</para>
3279 <para>Delete the user's Protection Database entry</para>
3281 </itemizedlist></para>
3283 <para>Before issuing the <emphasis role="bold">uss delete</emphasis> command, you can also perform the following optional tasks:
3286 <para>Copy the user's home volume to tape or another permanent medium and record the username and UID on a reserved list.
3287 This information enables you to restore the user's account easily if he or she returns to your cell. For information about
3288 using the AFS Backup System to back up volumes, see <link linkend="HDRWQ248">Configuring the AFS Backup System</link> and
3289 <link linkend="HDRWQ283">Backing Up and Restoring AFS Data</link>.</para>
3293 <para>If the user has exclusive use of any other volumes (such as a volume for storing project-related data), make a
3294 backup copy of each one and then remove it and its mount point as instructed in <link linkend="HDRWQ235">Removing Volumes
3295 and their Mount Points</link>.</para>
3299 <para>Use the <emphasis role="bold">pts listowned</emphasis> command to display any groups that the user owns;
3300 instructions appear in <link linkend="HDRWQ540">To list the groups that a user or group owns</link>. Decide whether to use
3301 the <emphasis role="bold">pts delete</emphasis> command to remove the groups or the <emphasis role="bold">pts
3302 chown</emphasis> command to transfer ownership to another user or group. Instructions appear in <link
3303 linkend="HDRWQ553">To delete Protection Database entries</link> and <link linkend="HDRWQ555">To change a group's
3304 owner</link>. Alternatively, you can have the user remove or transfer ownership of the groups before leaving. A group that
3305 remains in the Protection Database after its owner is removed is considered orphaned, and only members of the <emphasis
3306 role="bold">system:administrators</emphasis> group can administer it.</para>
3308 </itemizedlist></para>
3310 <para>You can automate some of these tasks by including <emphasis role="bold">exec</emphasis> instructions in the bulk input
3311 file and using the <emphasis role="bold">uss bulk</emphasis> command to delete the account. See <link
3312 linkend="HDRWQ488">Creating and Deleting Multiple Accounts with the uss bulk Command</link>.</para>
3314 <sect2 id="HDRWQ487">
3315 <title>To delete an AFS account</title>
3319 <para>Authenticate as an AFS identity with all of the following privileges. In the conventional configuration, the
3320 <emphasis role="bold">admin</emphasis> user account has them, or you possibly have a personal administrative account. (To
3321 increase cell security, it is best to create special privileged accounts for use only while performing administrative
3322 procedures; for further discussion, see <link linkend="HDRWQ584">An Overview of Administrative Privilege</link>.) If
3323 necessary, issue the <emphasis role="bold">klog</emphasis> command to authenticate. <programlisting>
3324 % <emphasis role="bold">klog</emphasis> admin_user
3325 Password: <<replaceable>admin_password</replaceable>>
3326 </programlisting></para>
3328 <para>The following list specifies the necessary privileges and indicates how to check that you have them.</para>
3332 <para>Membership in the <emphasis role="bold">system:administrators</emphasis> group. If necessary, issue the
3333 <emphasis role="bold">pts membership</emphasis> command, which is fully described in <link linkend="HDRWQ587">To
3334 display the members of the system:administrators group</link>. <programlisting>
3335 % <emphasis role="bold">pts membership system:administrators</emphasis>
3336 </programlisting></para>
3340 <para>Inclusion in the <emphasis role="bold">/usr/afs/etc/UserList</emphasis> file. If necessary, issue the <emphasis
3341 role="bold">bos listusers</emphasis> command, which is fully described in <link linkend="HDRWQ593">To display the
3342 users in the UserList file</link>. <programlisting>
3343 % <emphasis role="bold">bos listusers</emphasis> <<replaceable>machine name</replaceable>>
3344 </programlisting></para>
3348 <para>The <computeroutput>ADMIN</computeroutput> flag on the Authentication Database entry. However, the
3349 Authentication Server always prompts you for a password in order to perform its own authentication. The following
3350 instructions direct you to specify the administrative identity on the <emphasis role="bold">uss</emphasis> command
3355 <para>The <emphasis role="bold">d</emphasis> (<emphasis role="bold">delete</emphasis>) permission on the ACL of the
3356 directory that houses the user's home directory. If necessary, issue the <emphasis role="bold">fs listacl</emphasis>
3357 command, which is fully described in <link linkend="HDRWQ572">Displaying ACLs</link>. <programlisting>
3358 % <emphasis role="bold">fs listacl</emphasis> [<<replaceable>dir/file path</replaceable>>]
3359 </programlisting></para>
3361 <para>Members of the <emphasis role="bold">system:administrators</emphasis> group always implicitly have the <emphasis
3362 role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) and by default also the <emphasis
3363 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission on every ACL and can use the <emphasis
3364 role="bold">fs setacl</emphasis> command to grant other rights as necessary.</para>
3370 <para>Consider and resolve the issues discussed in the introduction to this section concerning the continued maintenance
3371 of a deleted user's account information, owned groups, and volumes.</para>
3375 <para><emphasis role="bold">(Optional)</emphasis> Run the <emphasis role="bold">uss delete</emphasis> command with the
3376 <emphasis role="bold">-dryrun</emphasis> flag to preview the deletion of the account. Note any error messages and correct
3377 the cause before reissuing the command without the <emphasis role="bold">-dryrun</emphasis> flag. The next step describes
3378 the <emphasis role="bold">uss delete</emphasis> command's syntax. <indexterm>
3379 <primary>uss commands</primary>
3381 <secondary>delete</secondary>
3382 </indexterm><indexterm>
3383 <primary>commands</primary>
3385 <secondary>uss delete</secondary>
3390 <para>Issue the <emphasis role="bold">uss delete</emphasis> command to delete the account. Enter the command on a single
3391 line; it appears here on multiple lines only for legibility.</para>
3393 <para>The delete operation always removes the user's entry from the Authentication Database. The Authentication Server
3394 performs its own authentication rather than accepting your existing AFS token. By default, it authenticates your local
3395 (UNIX) identity, which possibly does not correspond to an AFS-privileged administrator. Include the <emphasis
3396 role="bold">-admin</emphasis> argument to name an identity that has the <computeroutput>ADMIN</computeroutput> flag on its
3397 Authentication Database entry. To verify that an entry has the flag, issue the <emphasis role="bold">kas
3398 examine</emphasis> command as described in <link linkend="HDRWQ590">To check if the ADMIN flag is set</link>.</para>
3401 % <emphasis role="bold">uss delete</emphasis> <emphasis role="bold">-user</emphasis> <<replaceable>login name</replaceable>> \
3402 <emphasis role="bold">-mountpoint</emphasis> <<replaceable>mountpoint for user's volume</replaceable>> \
3403 [<emphasis role="bold">-savevolume</emphasis>] <emphasis role="bold">-admin</emphasis> <<replaceable>administrator to authenticate</replaceable>> \
3404 [<emphasis role="bold">-dryrun</emphasis>]
3405 Administrator's (admin_user) password: <<replaceable>admin_password</replaceable>>
3408 <para>where <variablelist>
3410 <term><emphasis role="bold">d</emphasis></term>
3413 <para>Is the shortest acceptable abbreviation of <emphasis role="bold">delete</emphasis>.</para>
3418 <term><emphasis role="bold">-user</emphasis></term>
3421 <para>Names the entry to delete from the Protection and Authentication Databases.</para>
3426 <term><emphasis role="bold">-mountpoint</emphasis></term>
3429 <para>Specifies the pathname of the mount point to delete (the user's home directory). Unless the <emphasis
3430 role="bold">-savevolume</emphasis> argument is included, the volume mounted there is also deleted from the file
3431 server machine where it resides, as is its record from the VLDB. Partial pathnames are interpreted relative to the
3432 current working directory.</para>
3434 <para>Specify the read/write path to the mount point, to avoid the failure that results when you attempt to delete
3435 a mount point from a read-only volume. By convention, you indicate the read/write path by placing a period before
3436 the cell name at the pathname's second level (for example, <emphasis role="bold">/afs/.example.com</emphasis>). For
3437 further discussion of the concept of read/write and read-only paths through the filespace, see <link
3438 linkend="HDRWQ208">Mounting Volumes</link>.</para>
3443 <term><emphasis role="bold">-savevolume</emphasis></term>
3446 <para>Retains the user's volume and VLDB entry.</para>
3451 <term><emphasis role="bold">-admin</emphasis></term>
3454 <para>Names an administrative account that has the <computeroutput>ADMIN</computeroutput> flag on its
3455 Authentication Database entry, such as <emphasis role="bold">admin</emphasis>. The password prompt echoes it as
3456 admin_user. Enter the appropriate password as admin_password.</para>
3461 <term><emphasis role="bold">-dryrun</emphasis></term>
3464 <para>Reports actions that the command interpreter needs to perform to run the command, without actually
3465 performing them.</para>
3468 </variablelist></para>
3472 <para>If the deleted user home directory resided in a replicated volume, use the <emphasis role="bold">vos
3473 release</emphasis> command to release the volume, as described in <link linkend="HDRWQ194">To replicate a read/write
3474 volume (create a read-only volume)</link>. <programlisting>
3475 % <emphasis role="bold">vos release</emphasis> <<replaceable>volume name or ID</replaceable>>
3476 </programlisting></para>
3479 <para>This step can be necessary even if the home directory's parent directory is not itself a mount point for a
3480 replicated volume (and is easier to overlook in that case). For example, the Example Corporation template puts the mount
3481 points for user volumes in the <emphasis role="bold">/afs/example.com/usr</emphasis> directory. Because that is a regular
3482 directory rather than a mount point, it resides in the <emphasis role="bold">root.cell</emphasis> volume mounted at the
3483 <emphasis role="bold">/afs/example.com</emphasis> directory. That volume is replicated, so after changing it by deleting a
3484 mount point the administrator must issue the <emphasis role="bold">vos release</emphasis> command.</para>
3489 <para>Delete the user's entry from the local password file (<emphasis role="bold">/etc/passwd</emphasis> or equivalent) of
3490 each client machine.
3491 If you intend to reactivate the user's account in the future, it is
3492 simpler to comment out the entry or place an asterisk (*) in the password field.</para>
3497 <primary>creating</primary>
3499 <secondary>user accounts in bulk with uss</secondary>
3503 <primary>user account</primary>
3505 <secondary>creating/deleting many at once</secondary>
3509 <primary>bulk mode in uss</primary>
3513 <primary>deleting</primary>
3515 <secondary>user accounts in bulk with uss</secondary>
3519 <primary>uss commands</primary>
3521 <secondary>creating/deleting user accounts in bulk</secondary>
3526 <sect1 id="HDRWQ488">
3527 <title>Creating and Deleting Multiple Accounts with the uss bulk Command</title>
3529 <para>The <emphasis role="bold">uss bulk</emphasis> command allows you to create and delete many accounts at once. Before
3530 executing the command, you must <itemizedlist>
3532 <para>Construct a template if you plan to create any accounts, just as you must do before running the <emphasis
3533 role="bold">uss add</emphasis> command. The same template applies to all accounts created by a single <emphasis
3534 role="bold">uss bulk</emphasis> command.</para>
3538 <para>Construct a bulk input file of instructions that create and delete accounts and execute any related commands, as
3539 described in <link linkend="HDRWQ489">Constructing a Bulk Input File</link>.</para>
3541 </itemizedlist></para>
3544 <primary>rules</primary>
3546 <secondary>for uss bulk input file</secondary>
3550 <primary>uss bulk input file</primary>
3552 <secondary>rules for constructing</secondary>
3555 <sect2 id="HDRWQ489">
3556 <title>Constructing a Bulk Input File</title>
3558 <para>You can include five types of instructions in a bulk input file: <emphasis role="bold">add</emphasis>, <emphasis
3559 role="bold">delete</emphasis>, <emphasis role="bold">exec</emphasis>, <emphasis role="bold">savevolume</emphasis>, and
3560 <emphasis role="bold">delvolume</emphasis>. The following sections discuss their uses.</para>
3562 <para><emphasis role="bold">Creating a User Account with the add Instruction</emphasis></para>
3564 <para>Each <emphasis role="bold">add</emphasis> instruction creates a single user account, and so is basically the equivalent
3565 of issuing one <emphasis role="bold">uss add</emphasis> command. There is no limit to the number of <emphasis
3566 role="bold">add</emphasis> instructions in the bulk input file.</para>
3568 <para>As indicated by the following syntax statement, the order of the instruction's fields matches the order of arguments to
3569 the <emphasis role="bold">uss add</emphasis> command (though some of the command's arguments do not have a corresponding
3570 field). Like the <emphasis role="bold">uss add</emphasis> command's arguments, many of the fields provide a value for a
3571 variable in the <emphasis role="bold">uss</emphasis> template file. Each instruction must be a single line in the file (have a
3572 newline character only at its end); it appears on multiple lines here only for legibility.</para>
3574 <programlisting><emphasis role="bold">add</emphasis> username[<emphasis role="bold">:</emphasis>full_name][<emphasis
3575 role="bold">:</emphasis>initial_password][<emphasis role="bold">:</emphasis>password_expires]
3576 [<emphasis role="bold">:</emphasis>file_server][<emphasis role="bold">:</emphasis>partition][<emphasis role="bold">:</emphasis>mount_point][<emphasis
3577 role="bold">:</emphasis>uid]
3578 [<emphasis role="bold">:</emphasis>var1][<emphasis role="bold">:</emphasis>var2][<emphasis role="bold">:</emphasis>var3][<emphasis
3579 role="bold">:</emphasis>var4][<emphasis role="bold">:</emphasis>var5][<emphasis role="bold">:</emphasis>var6][<emphasis
3580 role="bold">:</emphasis>var7][<emphasis role="bold">:</emphasis>var8][<emphasis role="bold">:</emphasis>var9][<emphasis
3581 role="bold">:</emphasis>]
3584 <para>For a complete description of the acceptable values in each field, see the <emphasis role="bold">uss Bulk Input
3585 File</emphasis> reference page in the <emphasis>OpenAFS Administration Reference</emphasis>, or the description of the
3586 corresponding arguments to the <emphasis role="bold">uss add</emphasis> command, in <link linkend="HDRWQ483">To create an AFS
3587 account with the uss add command</link>. Following are some basic notes: <itemizedlist>
3589 <para>Begin the line with the string <emphasis role="bold">add</emphasis> only, not <emphasis role="bold">uss
3590 add</emphasis>.</para>
3594 <para>Only the first argument, username, is required. It corresponds to the <emphasis role="bold">-user</emphasis>
3595 argument to the <emphasis role="bold">uss add</emphasis> command.</para>
3599 <para>Do not surround the full_name value with double quotes, even though you must use them around the value for the
3600 <emphasis role="bold">-realname</emphasis> argument to the <emphasis role="bold">uss add</emphasis> command.</para>
3604 <para>If you want to omit a value for an argument, indicate an empty field by using two colons with nothing between
3605 them. Leaving a field empty is acceptable if the corresponding command line argument is optional or if the corresponding
3606 variable does not appear in the template file. For every field that precedes the last one to which you assign an actual
3607 value, you must either provide a value or indicate an empty field. It is acceptable, but not necessary, to indicate
3608 empty fields after the last one in which you assign a value.</para>
3612 <para>After the last field, end the line with either a colon and newline character (<emphasis
3613 role="bold"><Return></emphasis>), or a newline alone.</para>
3617 <para>The final nine fields are for assigning values to the number variables ($1 through $9), with the fields listed in
3618 increasing numerical order. Specify the value only, not the variable number.</para>
3620 </itemizedlist></para>
3622 <para><emphasis role="bold">Deleting a User Account with the delete Instruction</emphasis></para>
3624 <para>Each <emphasis role="bold">delete</emphasis> instruction deletes a single user account, and so is basically the
3625 equivalent of issuing one <emphasis role="bold">uss delete</emphasis> command. There is no limit to the number of <emphasis
3626 role="bold">delete</emphasis> instructions in the bulk input file.</para>
3628 <para>Like all instructions in the bulk input file, each <emphasis role="bold">delete</emphasis> instruction must be a single
3629 line in the file (have a newline character only at its end), even though it can cover multiple lines on a display screen. The
3630 curly braces (<emphasis role="bold">{ }</emphasis>) indicate two mutually exclusive choices.</para>
3632 <programlisting><emphasis role="bold">delete</emphasis> username<emphasis role="bold">:</emphasis>mount_point_path[:{ <emphasis
3633 role="bold">savevolume</emphasis> | <emphasis role="bold">delvolume</emphasis> }][<emphasis role="bold">:</emphasis>]
3636 <para>For a complete description of the acceptable values in each field, see the <emphasis role="bold">uss Bulk Input
3637 File</emphasis> reference page in the <emphasis>OpenAFS Administration Reference</emphasis> or the description of the
3638 corresponding arguments to the <emphasis role="bold">uss delete</emphasis> command, in <link linkend="HDRWQ487">To delete an
3639 AFS account</link>. Following are some basic notes: <itemizedlist>
3641 <para>Begin the line with the string <emphasis role="bold">delete</emphasis> only, not <emphasis role="bold">uss
3642 delete</emphasis>.</para>
3646 <para>The first two arguments, username and mount_point_path, are required. They correspond to the <emphasis
3647 role="bold">-user</emphasis> and <emphasis role="bold">-mountpoint</emphasis> arguments to the <emphasis role="bold">uss
3648 delete</emphasis> command.</para>
3652 <para>The third field, which is optional, controls whether the user's home volume is removed from the file server where
3653 it resides, along with the corresponding VLDB entry. There are three possible values: <itemizedlist>
3655 <para>No value treats the volume and VLDB entry according to the prevailing default, which is established by a
3656 preceding <emphasis role="bold">savevolume</emphasis> or <emphasis role="bold">delvolume</emphasis> instruction in
3657 the template file. See the following discussion of those instructions to learn how the default is set.</para>
3661 <para>The string <emphasis role="bold">savevolume</emphasis> preserves the volume and VLDB entry, overriding the
3666 <para>The string <emphasis role="bold">delvolume</emphasis> removes the volume and VLDB entry, overriding the
3669 </itemizedlist></para>
3673 <para>After the last field, end the line with either a colon and newline character (<emphasis
3674 role="bold"><Return></emphasis>), or a newline alone.</para>
3676 </itemizedlist></para>
3678 <para><emphasis role="bold">Running a Command or Script with the exec Instruction</emphasis></para>
3680 <para>The <emphasis role="bold">exec</emphasis> instruction runs the indicated AFS command, compiled program, or UNIX shell
3681 script or command. The command processor assumes the AFS and local identities of the issuer of the <emphasis role="bold">uss
3682 bulk</emphasis> command, who must have the privileges required to run the command.</para>
3684 <para>The instruction's syntax is as follows:</para>
3686 <programlisting><emphasis role="bold">exec</emphasis> command
3689 <para>It is not necessary to surround the command string with double quotes (" ") or other delimiters.</para>
3691 <para><emphasis role="bold">Setting the Default Treatment of Volumes with the delvolume and savevolume
3692 Instructions</emphasis></para>
3694 <para>The <emphasis role="bold">savevolume</emphasis> and <emphasis role="bold">delvolume</emphasis> instructions set the
3695 default treatment of volumes referenced by the <emphasis role="bold">delete</emphasis> instructions that follow them in the
3696 bulk input file. Their syntax is as follows:</para>
3699 <emphasis role="bold">savevolume</emphasis>
3700 <emphasis role="bold">delvolume</emphasis>
3703 <para>Both instructions are optional and take no arguments. If neither appears in the bulk input file, then by default all
3704 volumes and VLDB entries referenced by <emphasis role="bold">delete</emphasis> instructions are removed. If the <emphasis
3705 role="bold">savevolume</emphasis> instruction appears in the file, it prevents the removal of the volume and VLDB entry
3706 referenced by all subsequent <emphasis role="bold">delete</emphasis> instructions in the file. The <emphasis
3707 role="bold">delvolume</emphasis> instruction explicitly establishes the default (which is deletion) for subsequent <emphasis
3708 role="bold">delete</emphasis> instructions.</para>
3710 <para>The effect of either instruction lasts until the end of the bulk input file, or until its opposite appears. To override
3711 the prevailing default for a particular <emphasis role="bold">delete</emphasis> instruction, put the <emphasis
3712 role="bold">savevolume</emphasis> or <emphasis role="bold">delvolume</emphasis> string in the instruction's third field. (You
3713 can also use multiple instances of the <emphasis role="bold">savevolume</emphasis> and <emphasis
3714 role="bold">delvolume</emphasis> instructions to toggle back and forth between default preservation and deletion of
3718 <sect2 id="Header_570">
3719 <title>Example Bulk Input File Instructions</title>
3721 <para>To create an authentication-only account, use an <emphasis role="bold">add</emphasis> instruction like the following
3722 example, which includes only the first (username) argument. The user's real name is set to match the username (<emphasis
3723 role="bold">anderson</emphasis>) and her initial password is set to the string <emphasis
3724 role="bold">changeme</emphasis>.</para>
3730 <para>The following example also creates an authentication-only account, but sets nondefault values for the real name and
3731 initial password.</para>
3734 add smith:John Smith:js_pswd
3737 <para>The next two example <emphasis role="bold">add</emphasis> instructions require that the administrator of the Example
3738 Corporation cell (<emphasis role="bold">example.com</emphasis>) has written a <emphasis role="bold">uss</emphasis> template file
3739 with the following <emphasis role="bold">V</emphasis> instruction in it:</para>
3742 V user.$USER $SERVER.example.com /vicep$PART 10000 /afs/.example.com/usr/$3/$USER \
3746 <para>To create accounts for users named John Smith from the Marketing Department and Pat Jones from the Finance Department,
3747 the appropriate <emphasis role="bold">add</emphasis> instructions in the bulk input file are as follows:</para>
3750 add smith:John Smith:::fs1:a:::::marketing
3751 add jones:Pat Jones:::fs3:c:::::finance
3754 <para>The new account for Smith consists of Protection and Authentication Database entries called <emphasis
3755 role="bold">smith</emphasis>. His initial password is the default string <emphasis role="bold">changeme</emphasis>, and the
3756 Protection Server generates his AFS UID. His home volume, called <emphasis role="bold">user.smith</emphasis>, has a 10,000 KB
3757 quota, resides on partition <emphasis role="bold">/vicepa</emphasis> of file server machine <emphasis
3758 role="bold">fs1.example.com</emphasis>, and is mounted at <emphasis role="bold">/afs/.example.com/usr/marketing/smith</emphasis>. The
3759 final <emphasis role="bold">$UID $USER all</emphasis> part of the <emphasis role="bold">V</emphasis> instruction gives him
3760 ownership of his home directory and all permissions on its ACL. The account for <emphasis role="bold">jones</emphasis> is
3761 similar, except that it resides on partition <emphasis role="bold">/vicepc</emphasis> of file server machine <emphasis
3762 role="bold">fs3.example.com</emphasis> and is mounted at <emphasis role="bold">/afs/.example.com/usr/finance/jones</emphasis>.</para>
3764 <para>Notice that the fields corresponding to mount_point, uid, var1, and var2 are empty (between the values
3765 <computeroutput>a</computeroutput> and <computeroutput>marketing</computeroutput> on the first example line) because the
3766 corresponding variables do not appear in the <emphasis role="bold">V</emphasis> instruction in the template file. The
3767 initial_passwd and password_expires fields are also empty.</para>
3769 <para>If you wish, you can specify values or empty fields for all nine number variables in an <emphasis
3770 role="bold">add</emphasis> instruction. In that case, the bulk input file instructions are as follows:</para>
3773 add smith:John Smith:::fs1:a:::::marketing::::::
3774 add jones:Pat Jones:::fs3:c:::::finance::::::
3777 <para>The following example is a section of a bulk input file with a number of <emphasis role="bold">delete</emphasis>
3778 instructions and a <emphasis role="bold">savevolume</emphasis> instruction. Because the first three instructions appear before
3779 the <emphasis role="bold">savevolume</emphasis> instruction and their third field is blank, the corresponding volumes and VLDB
3780 entries are removed. The <emphasis role="bold">delete</emphasis> instruction for user <emphasis role="bold">terry</emphasis>
3781 follows the <emphasis role="bold">savevolume</emphasis> instruction, so her volume is not removed, but the volume for user
3782 <emphasis role="bold">johnson</emphasis> is, because the <emphasis role="bold">delvolume</emphasis> string in the third field
3783 of the <emphasis role="bold">delete</emphasis> instruction overrides the current default.</para>
3786 delete smith:/afs/example.com/usr/smith
3787 delete pat:/afs/example.com/usr/pat
3788 delete rogers:/afs/example.com/usr/rogers
3790 delete terry:/afs/example.com/usr/terry
3791 delete johnson:/afs/example.com/usr/johnson:delvolume
3794 <para>The following example <emphasis role="bold">exec</emphasis> instruction is useful as a separator between a set of
3795 <emphasis role="bold">add</emphasis> instructions and a set of <emphasis role="bold">delete</emphasis> instructions. It
3796 generates a message on the standard output stream that informs you of the <emphasis role="bold">uss bulk</emphasis> command's
3800 exec echo "Additions completed; beginning deletions..."
3804 <sect2 id="Header_571">
3805 <title>To create and delete multiple AFS user accounts</title>
3809 <para>Authenticate as an AFS identity with all of the following privileges. In the conventional configuration, the
3810 <emphasis role="bold">admin</emphasis> user account has them, or you possibly have a personal administrative account. (To
3811 increase cell security, it is best to create special privileged accounts for use only while performing administrative
3812 procedures; for further discussion, see <link linkend="HDRWQ584">An Overview of Administrative Privilege</link>.) If
3813 necessary, issue the <emphasis role="bold">klog</emphasis> command to authenticate. <programlisting>
3814 % <emphasis role="bold">klog</emphasis> admin_user
3815 Password: <<replaceable>admin_password</replaceable>>
3816 </programlisting></para>
3818 <para>The following list specifies the necessary privileges and indicates how to check that you have them.</para>
3822 <para>Membership in the <emphasis role="bold">system:administrators</emphasis> group. If necessary, issue the
3823 <emphasis role="bold">pts membership</emphasis> command, which is fully described in <link linkend="HDRWQ587">To
3824 display the members of the system:administrators group</link>. <programlisting>
3825 % <emphasis role="bold">pts membership system:administrators</emphasis>
3826 </programlisting></para>
3830 <para>Inclusion in the <emphasis role="bold">/usr/afs/etc/UserList</emphasis> file. If necessary, issue the <emphasis
3831 role="bold">bos listusers</emphasis> command, which is fully described in <link linkend="HDRWQ593">To display the
3832 users in the UserList file</link>. <programlisting>
3833 % <emphasis role="bold">bos listusers</emphasis> <<replaceable>machine name</replaceable>>
3834 </programlisting></para>
3838 <para>The <computeroutput>ADMIN</computeroutput> flag on the Authentication Database entry. However, the
3839 Authentication Server always prompts you for a password in order to perform its own authentication. The following
3840 instructions direct you to specify the administrative identity on the <emphasis role="bold">uss</emphasis> command
3845 <para>The <emphasis role="bold">d</emphasis> (<emphasis role="bold">delete</emphasis>), <emphasis
3846 role="bold">i</emphasis> (<emphasis role="bold">insert</emphasis>) and <emphasis role="bold">l</emphasis> (<emphasis
3847 role="bold">lookup</emphasis>) permissions on the ACL of the parent directory for each volume mount point. If
3848 necessary, issue the <emphasis role="bold">fs listacl</emphasis> command, which is fully described in <link
3849 linkend="HDRWQ572">Displaying ACLs</link>. <programlisting>
3850 % <emphasis role="bold">fs listacl</emphasis> [<<replaceable>dir/file path</replaceable>>]
3851 </programlisting></para>
3853 <para>Members of the <emphasis role="bold">system:administrators</emphasis> group always implicitly have the <emphasis
3854 role="bold">a</emphasis> (<emphasis role="bold">administer</emphasis>) and by default also the <emphasis
3855 role="bold">l</emphasis> (<emphasis role="bold">lookup</emphasis>) permission on every ACL and can use the <emphasis
3856 role="bold">fs setacl</emphasis> command to grant other rights as necessary.</para>
3862 <para><emphasis role="bold">(Optional.)</emphasis> Log in as the local superuser <emphasis role="bold">root</emphasis>.
3863 This is necessary only if you are creating new files or directories in the local file system and want to designate an
3864 alternate owner as the object is created. For a discussion of the issues involved, see <link linkend="HDRWQ470">About
3865 Creating Local Disk Directories and Files</link>.</para>
3869 <para>If the bulk input file includes <emphasis role="bold">add</emphasis> instructions, verify the location and
3870 functionality of the template you are using. For a description of where the <emphasis role="bold">uss</emphasis> command
3871 interpreter expects to find the template, see <link linkend="HDRWQ468">Where to Place Template Files</link>. You can
3872 always provide an alternate pathname if you wish. Also note which variables appear in the template, to be sure that you
3873 provide the corresponding arguments in the <emphasis role="bold">add</emphasis> instruction or on the <emphasis
3874 role="bold">uss bulk</emphasis> command line.</para>
3878 <para>Create a bulk input file that complies with the rules listed in <link linkend="HDRWQ489">Constructing a Bulk Input
3879 File</link>. It is simplest to put the file in the same directory as the template file you are using.</para>
3883 <para><emphasis role="bold">(Optional.)</emphasis> Change to the directory where the bulk input file and template file
3884 reside. <programlisting>
3885 % <emphasis role="bold">cd</emphasis> template_directory
3886 </programlisting><indexterm>
3887 <primary>uss commands</primary>
3889 <secondary>bulk</secondary>
3890 </indexterm><indexterm>
3891 <primary>commands</primary>
3893 <secondary>uss bulk</secondary>
3898 <para>Issue the <emphasis role="bold">uss bulk</emphasis> command to create or delete accounts, or
3899 both. Enter the command on a single line; it appears here on multiple lines only for legibility.</para>
3901 <para>The bulk operation always manipulates user entries in the Authentication Database. The Authentication Server
3902 performs its own authentication rather than accepting your existing AFS token. By default, it authenticates your local
3903 (UNIX) identity, which possibly does not correspond to an AFS-privileged administrator. Include the <emphasis
3904 role="bold">-admin</emphasis> argument to name an identity that has the <computeroutput>ADMIN</computeroutput> flag on its
3905 Authentication Database entry. To verify that an entry has the flag, issue the <emphasis role="bold">kas
3906 examine</emphasis> command as described in <link linkend="HDRWQ590">To check if the ADMIN flag is set</link>.</para>
3909 % <emphasis role="bold">uss bulk</emphasis> <<replaceable>bulk input file</replaceable>> \
3910 [<emphasis role="bold">-template</emphasis> <<replaceable>pathname of template file</replaceable>>] \
3911 <emphasis role="bold">-admin</emphasis> <<replaceable>administrator to authenticate</replaceable>> \
3912 [<emphasis role="bold">-dryrun</emphasis>] [<emphasis role="bold">-overwrite</emphasis>] \
3913 [<emphasis role="bold">-pwexpires</emphasis> <<replaceable>password expires in [0..254] days (0 =</replaceable>> never)>] \
3914 [<emphasis role="bold">-pipe</emphasis>]
3915 Administrator's (admin_user) password: <<replaceable>admin_password</replaceable>>
3918 <para>where <variablelist>
3920 <term><emphasis role="bold">b</emphasis></term>
3923 <para>Is the shortest acceptable abbreviation of <emphasis role="bold">bulk</emphasis>.</para>
3928 <term><emphasis role="bold">bulk input file</emphasis></term>
3931 <para>Specifies the pathname of the bulk input file. Partial pathnames are interpreted relative to the current
3932 working directory. For a discussion of the required file format, see <link linkend="HDRWQ489">Constructing a Bulk
3933 Input File</link>.</para>
3938 <term><emphasis role="bold">-template</emphasis></term>
3941 <para>Specifies the pathname of the template file for any <emphasis role="bold">uss add</emphasis> commands that
3942 appear in the bulk input file. Partial pathnames are interpreted relative to the current working directory. For a
3943 discussion of the required file format, see <link linkend="HDRWQ463">Constructing a uss Template
3949 <term><emphasis role="bold">-admin</emphasis></term>
3952 <para>Names an administrative account that has the <computeroutput>ADMIN</computeroutput> flag on its
3953 Authentication Database entry, such as the <emphasis role="bold">admin</emphasis> account. The password prompt
3954 echoes it as admin_user. Enter the appropriate password as admin_password.</para>
3959 <term><emphasis role="bold">-dryrun</emphasis></term>
3962 <para>Reports actions that the command interpreter needs to perform to run the command, without actually
3963 performing them.</para>
3968 <term><emphasis role="bold">-overwrite</emphasis></term>
3971 <para>Overwrites any directories, files and links that exist in the file system and for which there are also
3972 <emphasis role="bold">D</emphasis>, <emphasis role="bold">E</emphasis>, <emphasis role="bold">F</emphasis>,
3973 <emphasis role="bold">L</emphasis>, or <emphasis role="bold">S</emphasis> instructions in the template file named
3974 by the <emphasis role="bold">-template</emphasis> argument. If this flag is omitted, the command interpreter
3975 prompts, once for each <emphasis role="bold">add</emphasis> instruction in the bulk input file, for confirmation
3976 that it is to overwrite such elements. Do not include this flag if there are no <emphasis
3977 role="bold">add</emphasis> instructions in the bulk input file.</para>
3982 <term><emphasis role="bold">-pwexpires</emphasis></term>
3985 <para>Sets the number of days after a user's password is changed that it remains valid, for each user named by an
3986 <emphasis role="bold">add</emphasis> instruction in the bulk input file. Provide an integer from the range
3987 <emphasis role="bold">1</emphasis> through <emphasis role="bold">254</emphasis> to specify the number of days
3988 until expiration, or the value <emphasis role="bold">0</emphasis> to indicate that the password never expires (the
3991 <para>When the password becomes invalid (expires), the user is unable to authenticate, but has 30 more days in
3992 which to issue the <emphasis role="bold">kpasswd</emphasis> command to change the password (after that, only an
3993 administrator can change it).</para>
3998 <term><emphasis role="bold">-pipe</emphasis></term>
4001 <para>Suppresses the Authentication Server's prompt for the password of the issuer or the user named by the
4002 <emphasis role="bold">-admin</emphasis> argument (the Authentication Server always separately authenticates the
4003 user who is creating or deleting an entry in the Authentication Database). Instead, the command interpreter
4004 accepts the password as piped input from another program, enabling you to run the <emphasis role="bold">uss
4005 bulk</emphasis> command in unattended batch jobs.</para>
4008 </variablelist></para>
4012 <para>If a newly created or deleted user home directory resides in a replicated volume, use the <emphasis role="bold">vos
4013 release</emphasis> command to release the volume, as described in <link linkend="HDRWQ194">To replicate a read/write
4014 volume (create a read-only volume)</link>. <programlisting>
4015 % <emphasis role="bold">vos release</emphasis> <<replaceable>volume name or ID</replaceable>>
4016 </programlisting></para>
4019 <para>This step can be necessary even if the home directory's parent directory is not itself a mount point for a
4020 replicated volume (and is easier to overlook in that case). For example, the Example Corporation template puts the mount
4021 points for user volumes in the <emphasis role="bold">/afs/example.com/usr</emphasis> directory. Because that is a regular
4022 directory rather than a mount point, it resides in the <emphasis role="bold">root.cell</emphasis> volume mounted at the
4023 <emphasis role="bold">/afs/example.com</emphasis> directory. That volume is replicated, so after changing it by creating or
4024 deleting a mount point, the administrator must issue the <emphasis role="bold">vos release</emphasis> command.</para>
4029 <para>If you are creating accounts, create an entry for the new user in the local password file (<emphasis
4030 role="bold">/etc/passwd</emphasis> or equivalent) on each AFS client machine that he or she can log into. For suggestions
4031 on automating this step, see <link linkend="HDRWQ458">Creating a Common Source Password File</link>.</para>
4033 <para>Even if you do not use the automated method, set the user's UNIX UID to match the AFS UID assigned automatically by
4034 the Protection Server or assigned with the <emphasis role="bold">-uid</emphasis> argument. The new user's AFS UID appears
4035 in the trace produced by the <emphasis role="bold">uss add</emphasis> output or you can use the <emphasis role="bold">pts
4036 examine</emphasis> command to display it, as described in <link linkend="HDRWQ537">To display a Protection Database
4037 entry</link>.</para>
4041 <para>If you are deleting accounts, delete the user's entry from the local password file (<emphasis
4042 role="bold">/etc/passwd</emphasis> or equivalent) of each client machine.
4043 If you intend to reactivate the user's account in the future, it is simpler to comment out the entry or place an asterisk
4044 (*) in the password field.</para>