index: formatting
[openafs-wiki.git] / EnablingAFSLoginonSolarisSystems.mdwn
1 [[!toc levels=3]]
2
3 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.
4
5 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).
6
7 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.
8
9 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.
10
11 The recommended AFS-related entries in the PAM configuration file make use of one or more of the following three attributes.
12
13     try_first_pass
14
15 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.
16
17     ignore_root
18
19 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).
20
21     setenv_password_expires
22
23 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.
24
25 Perform the following steps to enable AFS login.
26
27 1. Mount the AFS CD-ROM for Solaris on the /cdrom directory, if it is not already. Then change directory as indicated.
28
29        # cd /usr/lib/security
30
31 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.
32
33 If you use the AFS Authentication Server (kaserver process):
34
35        # cp /cdrom/sysname/dest/lib/pam_afs.so.1 .
36
37        # ln -s pam_afs.so.1 pam_afs.so
38
39 If you use a Kerberos implementation of AFS authentication:
40
41        # cp /cdrom/sysname/dest/lib/pam_afs.krb.so.1 .
42
43        # ln -s pam_afs.krb.so.1 pam_afs.so
44
45 If the pam library is owned by the wrong group, it will fail to be called when you login.
46
47 ## Solaris 9
48
49        # chown root:bin pam_afs.krb.so.1
50
51 ## Solaris 8
52
53        # chown root:sys pam_afs.krb.so.1
54
55 # Edit pam.conf
56
57 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.
58
59 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.
60
61 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.
62
63 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.
64
65 ## pam.conf configuration for Solaris 9
66
67 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.
68
69 The "other" section is used by SSH authentication.
70
71 Solaris 9 will not allow the line continuation char "\\" in pam.conf
72
73        login   auth required           pam_unix_auth.so.1
74        login   auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root  setenv_password_expires
75
76        rlogin  auth required           pam_unix_auth.so.1
77        rlogin  auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root  setenv_password_expires
78
79        rsh     auth required           pam_unix_auth.so.1
80        rsh     auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root
81
82        #
83        # Used when service name is not explicitly mentioned for authenctication
84        #
85        other   auth requisite          pam_authtok_get.so.1
86        other   auth required           pam_dhkeys.so.1
87        other   auth required           pam_unix_auth.so.1
88        other   auth optional           /usr/lib/security/pam_afs.so try_first_pass  ignore_root  setenv_password_expires
89
90     #   ftp     auth  optional  /usr/lib/security/pam_unix.so.1
91     #   ftp     auth  optional  /usr/lib/security/pam_afs.so  try_first_pass  ignore_root
92     #   telnet  auth  optional  /usr/lib/security/pam_unix.so.1
93     #   telnet  auth  optional  /usr/lib/security/pam_afs.so  try_first_pass  ignore_root  setenv_password_expires
94
95 ##  pam.conf configuration for Solaris 6
96
97        login   auth  optional  /usr/lib/security/pam_unix.so.1
98        login   auth  optional  /usr/lib/security/pam_afs.so       \
99              try_first_pass  ignore_root  setenv_password_expires
100        rlogin  auth  optional  /usr/lib/security/pam_unix.so.1
101        rlogin  auth  optional  /usr/lib/security/pam_afs.so       \
102              try_first_pass  ignore_root  setenv_password_expires
103        rsh     auth  optional  /usr/lib/security/pam_unix.so.1
104        rsh     auth  optional  /usr/lib/security/pam_afs.so       \
105              try_first_pass  ignore_root
106        ftp     auth  optional  /usr/lib/security/pam_unix.so.1
107        ftp     auth  optional  /usr/lib/security/pam_afs.so       \
108              try_first_pass  ignore_root
109        telnet  auth  optional  /usr/lib/security/pam_unix.so.1
110        telnet  auth  optional  /usr/lib/security/pam_afs.so       \
111              try_first_pass  ignore_root  setenv_password_expires
112
113 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.
114
115        dtlogin   auth  optional  /usr/lib/security/pam_unix.so.1
116        dtlogin   auth  optional  /usr/lib/security/pam_afs.so     \
117              try_first_pass  ignore_root
118        dtsession  auth  optional /usr/lib/security/pam_unix.so.1
119        dtsession  auth  optional /usr/lib/security/pam_afs.so     \
120              try_first_pass  ignore_root
121
122 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.
123
124 The first possible alteration is to add the -local flag to the existing command, so that it looks like the following:
125
126             find $dir -local -type f -name .nfs\* -mtime +7 -mount -exec rm -f {} \;
127
128 Another alternative is to exclude any directories whose names begin with the lowercase letter a or a non-alphabetic character.
129
130        find /[A-Zb-z]*  remainder of existing command
131
132 Do not use the following command, which still searches under the /afs directory, looking for a subdirectory of type 4.2.
133
134        find / -fstype 4.2     /* do not use */