1*ae771770SStanislav Sedov@c $Id$ 2c19800e8SDoug Rabson 3c19800e8SDoug Rabson@node Applications, Things in search for a better place, Setting up a realm, Top 4c19800e8SDoug Rabson 5c19800e8SDoug Rabson@chapter Applications 6c19800e8SDoug Rabson 7c19800e8SDoug Rabson@menu 8c19800e8SDoug Rabson* Authentication modules:: 9c19800e8SDoug Rabson* AFS:: 10c19800e8SDoug Rabson@end menu 11c19800e8SDoug Rabson 12c19800e8SDoug Rabson@node Authentication modules, AFS, Applications, Applications 13c19800e8SDoug Rabson@section Authentication modules 14c19800e8SDoug Rabson 15c19800e8SDoug RabsonThe problem of having different authentication mechanisms has been 16c19800e8SDoug Rabsonrecognised by several vendors, and several solutions have appeared. In 17c19800e8SDoug Rabsonmost cases these solutions involve some kind of shared modules that are 18c19800e8SDoug Rabsonloaded at run-time. Modules for some of these systems can be found in 19c19800e8SDoug Rabson@file{lib/auth}. Presently there are modules for Digital's SIA, 20c19800e8SDoug Rabsonand IRIX' @code{login} and @code{xdm} (in 21c19800e8SDoug Rabson@file{lib/auth/afskauthlib}). 22c19800e8SDoug Rabson 23c19800e8SDoug Rabson@menu 24c19800e8SDoug Rabson* Digital SIA:: 25c19800e8SDoug Rabson* IRIX:: 26c19800e8SDoug Rabson@end menu 27c19800e8SDoug Rabson 28c19800e8SDoug Rabson@node Digital SIA, IRIX, Authentication modules, Authentication modules 29c19800e8SDoug Rabson@subsection Digital SIA 30c19800e8SDoug Rabson 31c19800e8SDoug RabsonHow to install the SIA module depends on which OS version you're 32c19800e8SDoug Rabsonrunning. Tru64 5.0 has a new command, @file{siacfg}, which makes this 33c19800e8SDoug Rabsonprocess quite simple. If you have this program, you should just be able 34c19800e8SDoug Rabsonto run: 35c19800e8SDoug Rabson@example 36c19800e8SDoug Rabsonsiacfg -a KRB5 /usr/athena/lib/libsia_krb5.so 37c19800e8SDoug Rabson@end example 38c19800e8SDoug Rabson 39c19800e8SDoug RabsonOn older versions, or if you want to do it by hand, you have to do the 40c19800e8SDoug Rabsonfollowing (not tested by us on Tru64 5.0): 41c19800e8SDoug Rabson 42c19800e8SDoug Rabson@itemize @bullet 43c19800e8SDoug Rabson 44c19800e8SDoug Rabson@item 45c19800e8SDoug RabsonMake sure @file{libsia_krb5.so} is available in 46c19800e8SDoug Rabson@file{/usr/athena/lib}. If @file{/usr/athena} is not on local disk, you 47c19800e8SDoug Rabsonmight want to put it in @file{/usr/shlib} or someplace else. If you do, 48c19800e8SDoug Rabsonyou'll have to edit @file{krb5_matrix.conf} to reflect the new location 49c19800e8SDoug Rabson(you will also have to do this if you installed in some other directory 50c19800e8SDoug Rabsonthan @file{/usr/athena}). If you built with shared libraries, you will 51c19800e8SDoug Rabsonhave to copy the shared @file{libkrb.so}, @file{libdes.so}, 52c19800e8SDoug Rabson@file{libkadm.so}, and @file{libkafs.so} to a place where the loader can 53c19800e8SDoug Rabsonfind them (such as @file{/usr/shlib}). 54c19800e8SDoug Rabson@item 55c19800e8SDoug RabsonCopy (your possibly edited) @file{krb5_matrix.conf} to @file{/etc/sia}. 56c19800e8SDoug Rabson@item 57c19800e8SDoug RabsonApply @file{security.patch} to @file{/sbin/init.d/security}. 58c19800e8SDoug Rabson@item 59c19800e8SDoug RabsonTurn on KRB5 security by issuing @kbd{rcmgr set SECURITY KRB5} and 60c19800e8SDoug Rabson@kbd{rcmgr set KRB5_MATRIX_CONF krb5_matrix.conf}. 61c19800e8SDoug Rabson@item 62c19800e8SDoug RabsonDigital thinks you should reboot your machine, but that really shouldn't 63c19800e8SDoug Rabsonbe necessary. It's usually sufficient just to run 64c19800e8SDoug Rabson@kbd{/sbin/init.d/security start} (and restart any applications that use 65c19800e8SDoug RabsonSIA, like @code{xdm}.) 66c19800e8SDoug Rabson@end itemize 67c19800e8SDoug Rabson 68c19800e8SDoug RabsonUsers with local passwords (like @samp{root}) should be able to login 69c19800e8SDoug Rabsonsafely. 70c19800e8SDoug Rabson 71c19800e8SDoug RabsonWhen using Digital's xdm the @samp{KRB5CCNAME} environment variable isn't 72c19800e8SDoug Rabsonpassed along as it should (since xdm zaps the environment). Instead you 73c19800e8SDoug Rabsonhave to set @samp{KRB5CCNAME} to the correct value in 74c19800e8SDoug Rabson@file{/usr/lib/X11/xdm/Xsession}. Add a line similar to 75c19800e8SDoug Rabson@example 76c19800e8SDoug RabsonKRB5CCNAME=FILE:/tmp/krb5cc`id -u`_`ps -o ppid= -p $$`; export KRB5CCNAME 77c19800e8SDoug Rabson@end example 78c19800e8SDoug RabsonIf you use CDE, @code{dtlogin} allows you to specify which additional 79c19800e8SDoug Rabsonenvironment variables it should export. To add @samp{KRB5CCNAME} to this 80c19800e8SDoug Rabsonlist, edit @file{/usr/dt/config/Xconfig}, and look for the definition of 81c19800e8SDoug Rabson@samp{exportList}. You want to add something like: 82c19800e8SDoug Rabson@example 83c19800e8SDoug RabsonDtlogin.exportList: KRB5CCNAME 84c19800e8SDoug Rabson@end example 85c19800e8SDoug Rabson 86c19800e8SDoug Rabson@subsubheading Notes to users with Enhanced security 87c19800e8SDoug Rabson 88c19800e8SDoug RabsonDigital's @samp{ENHANCED} (C2) security, and Kerberos solve two 89c19800e8SDoug Rabsondifferent problems. C2 deals with local security, adds better control of 90c19800e8SDoug Rabsonwho can do what, auditing, and similar things. Kerberos deals with 91c19800e8SDoug Rabsonnetwork security. 92c19800e8SDoug Rabson 93c19800e8SDoug RabsonTo make C2 security work with Kerberos you will have to do the 94c19800e8SDoug Rabsonfollowing. 95c19800e8SDoug Rabson 96c19800e8SDoug Rabson@itemize @bullet 97c19800e8SDoug Rabson@item 98c19800e8SDoug RabsonReplace all occurrences of @file{krb5_matrix.conf} with 99c19800e8SDoug Rabson@file{krb5+c2_matrix.conf} in the directions above. 100c19800e8SDoug Rabson@item 101c19800e8SDoug RabsonYou must enable ``vouching'' in the @samp{default} database. This will 102c19800e8SDoug Rabsonmake the OSFC2 module trust other SIA modules, so you can login without 103c19800e8SDoug Rabsongiving your C2 password. To do this use @samp{edauth} to edit the 104c19800e8SDoug Rabsondefault entry @kbd{/usr/tcb/bin/edauth -dd default}, and add a 105c19800e8SDoug Rabson@samp{d_accept_alternate_vouching} capability, if not already present. 106c19800e8SDoug Rabson@item 107c19800e8SDoug RabsonFor each user who does @emph{not} have a local C2 password, you should 108c19800e8SDoug Rabsonset the password expiration field to zero. You can do this for each 109c19800e8SDoug Rabsonuser, or in the @samp{default} table. To do this use @samp{edauth} to 110c19800e8SDoug Rabsonset (or change) the @samp{u_exp} capability to @samp{u_exp#0}. 111c19800e8SDoug Rabson@item 112c19800e8SDoug RabsonYou also need to be aware that the shipped @file{login}, @file{rcp}, and 113c19800e8SDoug Rabson@file{rshd}, don't do any particular C2 magic (such as checking for 114c19800e8SDoug Rabsonvarious forms of disabled accounts), so if you rely on those features, 115c19800e8SDoug Rabsonyou shouldn't use those programs. If you configure with 116c19800e8SDoug Rabson@samp{--enable-osfc2}, these programs will, however, set the login 117c19800e8SDoug RabsonUID. Still: use at your own risk. 118c19800e8SDoug Rabson@end itemize 119c19800e8SDoug Rabson 120c19800e8SDoug RabsonAt present @samp{su} does not accept the vouching flag, so it will not 121c19800e8SDoug Rabsonwork as expected. 122c19800e8SDoug Rabson 123c19800e8SDoug RabsonAlso, kerberised ftp will not work with C2 passwords. You can solve this 124c19800e8SDoug Rabsonby using both Digital's ftpd and our on different ports. 125c19800e8SDoug Rabson 126c19800e8SDoug Rabson@strong{Remember}, if you do these changes you will get a system that 127c19800e8SDoug Rabsonmost certainly does @emph{not} fulfil the requirements of a C2 128c19800e8SDoug Rabsonsystem. If C2 is what you want, for instance if someone else is forcing 129c19800e8SDoug Rabsonyou to use it, you're out of luck. If you use enhanced security because 130c19800e8SDoug Rabsonyou want a system that is more secure than it would otherwise be, you 131c19800e8SDoug Rabsonprobably got an even more secure system. Passwords will not be sent in 132c19800e8SDoug Rabsonthe clear, for instance. 133c19800e8SDoug Rabson 134c19800e8SDoug Rabson@node IRIX, , Digital SIA, Authentication modules 135c19800e8SDoug Rabson@subsection IRIX 136c19800e8SDoug Rabson 137c19800e8SDoug RabsonThe IRIX support is a module that is compatible with Transarc's 138c19800e8SDoug Rabson@file{afskauthlib.so}. It should work with all programs that use this 139c19800e8SDoug Rabsonlibrary. This should include @command{login} and @command{xdm}. 140c19800e8SDoug Rabson 141c19800e8SDoug RabsonThe interface is not very documented but it seems that you have to copy 142c19800e8SDoug Rabson@file{libkafs.so}, @file{libkrb.so}, and @file{libdes.so} to 143c19800e8SDoug Rabson@file{/usr/lib}, or build your @file{afskauthlib.so} statically. 144c19800e8SDoug Rabson 145c19800e8SDoug RabsonThe @file{afskauthlib.so} itself is able to reside in 146c19800e8SDoug Rabson@file{/usr/vice/etc}, @file{/usr/afsws/lib}, or the current directory 147c19800e8SDoug Rabson(wherever that is). 148c19800e8SDoug Rabson 149c19800e8SDoug RabsonIRIX 6.4 and newer seem to have all programs (including @command{xdm} and 150c19800e8SDoug Rabson@command{login}) in the N32 object format, whereas in older versions they 151c19800e8SDoug Rabsonwere O32. For it to work, the @file{afskauthlib.so} library has to be in 152c19800e8SDoug Rabsonthe same object format as the program that tries to load it. This might 153c19800e8SDoug Rabsonrequire that you have to configure and build for O32 in addition to the 154c19800e8SDoug Rabsondefault N32. 155c19800e8SDoug Rabson 156c19800e8SDoug RabsonApart from this it should ``just work''; there are no configuration 157c19800e8SDoug Rabsonfiles. 158c19800e8SDoug Rabson 159c19800e8SDoug RabsonNote that recent Irix 6.5 versions (at least 6.5.22) have PAM, 160c19800e8SDoug Rabsonincluding a @file{pam_krb5.so} module. Not all relevant programs use 161c19800e8SDoug RabsonPAM, though, e.g.@: @command{ssh}. In particular, for console 162c19800e8SDoug Rabsongraphical login you need to turn off @samp{visuallogin} and turn on 163c19800e8SDoug Rabson@samp{xdm} with @command{chkconfig}. 164c19800e8SDoug Rabson 165c19800e8SDoug Rabson@node AFS, , Authentication modules, Applications 166c19800e8SDoug Rabson@section AFS 167c19800e8SDoug Rabson 168c19800e8SDoug Rabson@cindex AFS 169c19800e8SDoug RabsonAFS is a distributed filesystem that uses Kerberos for authentication. 170c19800e8SDoug Rabson 171c19800e8SDoug Rabson@cindex OpenAFS 172c19800e8SDoug Rabson@cindex Arla 173c19800e8SDoug RabsonFor more information about AFS see OpenAFS 174c19800e8SDoug Rabson@url{http://www.openafs.org/} and Arla 175c19800e8SDoug Rabson@url{http://www.stacken.kth.se/projekt/arla/}. 176c19800e8SDoug Rabson 177*ae771770SStanislav Sedov@subsection kafs and afslog 178*ae771770SStanislav Sedov@cindex afslog 179*ae771770SStanislav Sedov 180*ae771770SStanislav Sedov@manpage{afslog,1} will obtains AFS tokens for a number of cells. What cells to get 181*ae771770SStanislav Sedovtokens for can either be specified as an explicit list, as file paths to 182*ae771770SStanislav Sedovget tokens for, or be left unspecified, in which case will use whatever 183*ae771770SStanislav Sedovmagic @manpage{kafs,3} decides upon. 184*ae771770SStanislav Sedov 185*ae771770SStanislav SedovIf not told what cell to get credentials for, @manpage{kafs,3} will 186*ae771770SStanislav Sedovsearch for the files ThisCell and TheseCells in the locations 187*ae771770SStanislav Sedovspecified in @manpage{kafs,3} and try to get tokens for these cells 188*ae771770SStanislav Sedovand the cells specified in $HOME/.TheseCells. 189*ae771770SStanislav Sedov 190*ae771770SStanislav SedovMore usefully it will look at and ~/.TheseCells in your home directory 191*ae771770SStanislav Sedovand for each line which is a cell get afs token for these cells. 192*ae771770SStanislav Sedov 193*ae771770SStanislav SedovThe TheseCells file defines the the cells to which applications on the 194*ae771770SStanislav Sedovlocal client machine should try to aquire tokens for. It must reside in 195*ae771770SStanislav Sedovthe directories searched by @manpage{kafs,3} on every AFS client machine. 196*ae771770SStanislav Sedov 197*ae771770SStanislav SedovThe file is in ASCII format and contains one character string, the cell 198*ae771770SStanislav Sedovname, per line. Cell names are case sensitive, but most cell names 199*ae771770SStanislav Sedovare lower case. 200*ae771770SStanislav Sedov 201*ae771770SStanislav SedovSee manpage for @manpage{kafs,3} for search locations of ThisCell and TheseCells. 202*ae771770SStanislav Sedov 203c19800e8SDoug Rabson@subsection How to get a KeyFile 204c19800e8SDoug Rabson 205c19800e8SDoug Rabson@file{ktutil -k AFSKEYFILE:KeyFile get afs@@MY.REALM} 206c19800e8SDoug Rabson 207c19800e8SDoug Rabsonor you can extract it with kadmin 208c19800e8SDoug Rabson 209c19800e8SDoug Rabson@example 210c19800e8SDoug Rabsonkadmin> ext -k AFSKEYFILE:/usr/afs/etc/KeyFile afs@@My.CELL.NAME 211c19800e8SDoug Rabson@end example 212c19800e8SDoug Rabson 213c19800e8SDoug RabsonYou have to make sure you have a @code{des-cbc-md5} encryption type since that 214c19800e8SDoug Rabsonis the enctype that will be converted. 215c19800e8SDoug Rabson 216c19800e8SDoug Rabson@subsection How to convert a srvtab to a KeyFile 217c19800e8SDoug Rabson 218c19800e8SDoug RabsonYou need a @file{/usr/vice/etc/ThisCell} containing the cellname of your 219c19800e8SDoug RabsonAFS-cell. 220c19800e8SDoug Rabson 221c19800e8SDoug Rabson@file{ktutil copy krb4:/root/afs-srvtab AFSKEYFILE:/usr/afs/etc/KeyFile}. 222c19800e8SDoug Rabson 223c19800e8SDoug RabsonIf keyfile already exists, this will add the new key in afs-srvtab to 224c19800e8SDoug RabsonKeyFile. 225c19800e8SDoug Rabson 226c19800e8SDoug Rabson@section Using 2b tokens with AFS 227c19800e8SDoug Rabson 228c19800e8SDoug Rabson@subsection What is 2b ? 229c19800e8SDoug Rabson 230c19800e8SDoug Rabson2b is the name of the proposal that was implemented to give basic 231c19800e8SDoug RabsonKerberos 5 support to AFS in rxkad. It's not real Kerberos 5 support 232c19800e8SDoug Rabsonsince it still uses fcrypt for data encryption and not Kerberos 233c19800e8SDoug Rabsonencryption types. 234c19800e8SDoug Rabson 235c19800e8SDoug RabsonIts only possible (in all cases) to do this for DES encryption types 236c19800e8SDoug Rabsonbecause only then the token (the AFS equivalent of a ticket) will be 237c19800e8SDoug Rabsonsmaller than the maximum size that can fit in the token cache in the 238c19800e8SDoug RabsonOpenAFS/Transarc client. It is a so tight fit that some extra wrapping 239c19800e8SDoug Rabsonon the ASN1/DER encoding is removed from the Kerberos ticket. 240c19800e8SDoug Rabson 241c19800e8SDoug Rabson2b uses a Kerberos 5 EncTicketPart instead of a Kerberos 4 ditto for 242c19800e8SDoug Rabsonthe part of the ticket that is encrypted with the service's key. The 243c19800e8SDoug Rabsonclient doesn't know what's inside the encrypted data so to the client 244c19800e8SDoug Rabsonit doesn't matter. 245c19800e8SDoug Rabson 246c19800e8SDoug RabsonTo differentiate between Kerberos 4 tickets and Kerberos 5 tickets, 2b 247c19800e8SDoug Rabsonuses a special kvno, 213 for 2b tokens and 255 for Kerberos 5 tokens. 248c19800e8SDoug Rabson 249c19800e8SDoug RabsonIts a requirement that all AFS servers that support 2b also support 250c19800e8SDoug Rabsonnative Kerberos 5 in rxkad. 251c19800e8SDoug Rabson 252c19800e8SDoug Rabson@subsection Configuring a Heimdal kdc to use 2b tokens 253c19800e8SDoug Rabson 254c19800e8SDoug RabsonSupport for 2b tokens in the kdc are turned on for specific principals 255c19800e8SDoug Rabsonby adding them to the string list option @code{[kdc]use_2b} in the 256c19800e8SDoug Rabsonkdc's @file{krb5.conf} file. 257c19800e8SDoug Rabson 258c19800e8SDoug Rabson@example 259c19800e8SDoug Rabson[kdc] 260c19800e8SDoug Rabson use_2b = @{ 261c19800e8SDoug Rabson afs@@SU.SE = yes 262c19800e8SDoug Rabson afs/it.su.se@@SU.SE = yes 263c19800e8SDoug Rabson @} 264c19800e8SDoug Rabson@end example 265c19800e8SDoug Rabson 266c19800e8SDoug Rabson@subsection Configuring AFS clients for 2b support 267c19800e8SDoug Rabson 268c19800e8SDoug RabsonThere is no need to configure AFS clients for 2b support. The only 269c19800e8SDoug Rabsonsoftware that needs to be installed/upgrade is a Kerberos 5 enabled 270c19800e8SDoug Rabson@file{afslog}. 271