add a project for buildbot-driven unit tests
[openafs-wiki.git] / AFSLore / EnablingAFSLoginonSolarisSystems.mdwn
1 At this point you incorporate AFS into the operating system's Pluggable Authentication Module (PAM) scheme. PAM integrates all authentication mechanisms on the machine, including login, to provide the security infrastructure for authenticated access to and from the machine.
2
3 Explaining PAM is beyond the scope of this document. It is assumed that you understand the syntax and meanings of settings in the PAM configuration file (for example, how the other entry works, the effect of marking an entry as required, optional, or sufficient, and so on).
4
5 The following instructions explain how to alter the entries in the PAM configuration file for each service for which you wish to use AFS authentication. Other configurations possibly also work, but the instructions specify the recommended and tested configuration. Note: The instructions specify that you mark each entry as optional. However, marking some modules as optional can mean that they grant access to the corresponding service even when the user does not meet all of the module's requirements. In some operating system revisions, for example, if you mark as optional the module that controls login via a dial-up connection, it allows users to login without providing a password. See the IBM AFS Release Notes for a discussion of any limitations that apply to this operating system.
6
7 Also, with some operating system versions you must install patches for PAM to interact correctly with certain authentication programs. For details, see the IBM AFS Release Notes.
8
9 The recommended AFS-related entries in the PAM configuration file make use of one or more of the following three attributes.
10
11     try_first_pass
12
13 This is a standard PAM attribute that can be included on entries after the first one for a service; it directs the module to use the password that was provided to the first module. For the AFS module, it means that AFS authentication succeeds if the password provided to the module listed first is the user's correct AFS password. For further discussion of this attribute and its alternatives, see the operating system's PAM documentation.
14
15     ignore_root
16
17 This attribute, specific to the AFS PAM module, directs it to ignore not only the local superuser root, but also any user with UID 0 (zero).
18
19     setenv_password_expires
20
21 This attribute, specific to the AFS PAM module, sets the environment variable PASSWORD\_EXPIRES to the expiration date of the user's AFS password, which is recorded in the Authentication Database.
22
23 Perform the following steps to enable AFS login.
24
25 1. Mount the AFS CD-ROM for Solaris on the /cdrom directory, if it is not already. Then change directory as indicated.
26
27        # cd /usr/lib/security
28
29 1. Copy the AFS authentication library file to the /usr/lib/security directory. Then create a symbolic link to it whose name does not mention the version. Omitting the version eliminates the need to edit the PAM configuration file if you later update the library file.
30
31 If you use the AFS Authentication Server (kaserver process):
32
33        # cp /cdrom/sysname/dest/lib/pam_afs.so.1 .
34
35        # ln -s pam_afs.so.1 pam_afs.so
36
37 If you use a Kerberos implementation of AFS authentication:
38
39        # cp /cdrom/sysname/dest/lib/pam_afs.krb.so.1 .
40
41        # ln -s pam_afs.krb.so.1 pam_afs.so
42
43 If the pam library is owned by the wrong group, it will fail to be called when you login.
44
45 ## <a name="Solaris 9"></a> Solaris 9
46
47        # chown root:bin pam_afs.krb.so.1
48
49 ## <a name="Solaris 8"></a> Solaris 8
50
51        # chown root:sys pam_afs.krb.so.1
52
53 # <a name="Edit pam.conf"></a> Edit pam.conf
54
55 Edit the Authentication management section of the Solaris PAM configuration file, /etc/pam.conf by convention. The entries in this section have the value auth in their second field.
56
57 First edit the standard entries, which refer to the Solaris PAM module (usually, the file /usr/lib/security/pam\_unix.so.1) in their fourth field. For each service for which you want to use AFS authentication, edit the third field of its entry to read optional. The pam.conf file in the Solaris distribution usually includes standard entries for the login, rlogin, and rsh services, for instance.
58
59 If there are services for which you want to use AFS authentication, but for which the pam.conf file does not already include a standard entry, you must create that entry and place the value optional in its third field. For instance, the Solaris pam.conf file does not usually include standard entries for the ftp or telnet services.
60
61 Then create an AFS-related entry for each service, placing it immediately below the standard entry. The following example shows what the Authentication Management section looks like after you have you edited or created entries for the services mentioned previously. Note that the example AFS entries appear on two lines only for legibility.
62
63 ## <a name="pam.conf configuration for Solar"></a> pam.conf configuration for Solaris 9
64
65 Note: leave the full path to the library intact for afs. This will allow it to work for both 32 bit and 64 bit Solaris.
66
67 The "other" section is used by SSH authentication.
68
69 Solaris 9 will not allow the line continuation char "\\" in pam.conf
70
71        login   auth required           pam_unix_auth.so.1
72        login   auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root  setenv_password_expires
73
74        rlogin  auth required           pam_unix_auth.so.1
75        rlogin  auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root  setenv_password_expires
76
77        rsh     auth required           pam_unix_auth.so.1
78        rsh     auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root
79
80        #
81        # Used when service name is not explicitly mentioned for authenctication
82        #
83        other   auth requisite          pam_authtok_get.so.1
84        other   auth required           pam_dhkeys.so.1
85        other   auth required           pam_unix_auth.so.1
86        other   auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root  setenv_password_expires
87
88     #   ftp     auth  optional  /usr/lib/security/pam_unix.so.1
89     #   ftp     auth  optional  /usr/lib/security/pam_afs.so  try_first_pass  ignore_root
90     #   telnet  auth  optional  /usr/lib/security/pam_unix.so.1
91     #   telnet  auth  optional  /usr/lib/security/pam_afs.so  try_first_pass  ignore_root  setenv_password_expires
92
93 ## <a name="pam.conf configuration for Solar"></a> pam.conf configuration for Solaris 6
94
95        login   auth  optional  /usr/lib/security/pam_unix.so.1
96        login   auth  optional  /usr/lib/security/pam_afs.so       \
97              try_first_pass  ignore_root  setenv_password_expires
98        rlogin  auth  optional  /usr/lib/security/pam_unix.so.1
99        rlogin  auth  optional  /usr/lib/security/pam_afs.so       \
100              try_first_pass  ignore_root  setenv_password_expires
101        rsh     auth  optional  /usr/lib/security/pam_unix.so.1
102        rsh     auth  optional  /usr/lib/security/pam_afs.so       \
103              try_first_pass  ignore_root
104        ftp     auth  optional  /usr/lib/security/pam_unix.so.1
105        ftp     auth  optional  /usr/lib/security/pam_afs.so       \
106              try_first_pass  ignore_root
107        telnet  auth  optional  /usr/lib/security/pam_unix.so.1
108        telnet  auth  optional  /usr/lib/security/pam_afs.so       \
109              try_first_pass  ignore_root  setenv_password_expires
110
111 1. If you use the Common Desktop Environment (CDE) on the machine and want users to obtain an AFS token as they log in, also add or edit the following four entries in the Authentication management section. Note that the AFS-related entries appear on two lines here only for legibility.
112
113        dtlogin   auth  optional  /usr/lib/security/pam_unix.so.1
114        dtlogin   auth  optional  /usr/lib/security/pam_afs.so     \
115              try_first_pass  ignore_root
116        dtsession  auth  optional /usr/lib/security/pam_unix.so.1
117        dtsession  auth  optional /usr/lib/security/pam_afs.so     \
118              try_first_pass  ignore_root
119
120 1. Some Solaris distributions include a script that locates and removes unneeded files from various file systems. Its conventional location is /usr/lib/fs/nfs/nfsfind. The script generally uses an argument to the find command to define which file systems to search. In this step you modify the command to exclude the /afs directory. Otherwise, the command traverses the AFS filespace of every cell that is accessible from the machine, which can take many hours. The following alterations are possibilities, but you must verify that they are appropriate for your cell.
121
122 The first possible alteration is to add the -local flag to the existing command, so that it looks like the following:
123
124             find $dir -local -type f -name .nfs\* -mtime +7 -mount -exec rm -f {} \;
125
126 Another alternative is to exclude any directories whose names begin with the lowercase letter a or a non-alphabetic character.
127
128        find /[A-Zb-z]*  remainder of existing command
129
130 Do not use the following command, which still searches under the /afs directory, looking for a subdirectory of type 4.2.
131
132        find / -fstype 4.2     /* do not use */