1*ebfedea0SLionel Sambuc@c Id 2*ebfedea0SLionel Sambuc@c $NetBSD: apps.texi,v 1.1.1.2 2011/04/14 14:08:08 elric Exp $ 3*ebfedea0SLionel Sambuc 4*ebfedea0SLionel Sambuc@node Applications, Things in search for a better place, Setting up a realm, Top 5*ebfedea0SLionel Sambuc 6*ebfedea0SLionel Sambuc@chapter Applications 7*ebfedea0SLionel Sambuc 8*ebfedea0SLionel Sambuc@menu 9*ebfedea0SLionel Sambuc* Authentication modules:: 10*ebfedea0SLionel Sambuc* AFS:: 11*ebfedea0SLionel Sambuc@end menu 12*ebfedea0SLionel Sambuc 13*ebfedea0SLionel Sambuc@node Authentication modules, AFS, Applications, Applications 14*ebfedea0SLionel Sambuc@section Authentication modules 15*ebfedea0SLionel Sambuc 16*ebfedea0SLionel SambucThe problem of having different authentication mechanisms has been 17*ebfedea0SLionel Sambucrecognised by several vendors, and several solutions have appeared. In 18*ebfedea0SLionel Sambucmost cases these solutions involve some kind of shared modules that are 19*ebfedea0SLionel Sambucloaded at run-time. Modules for some of these systems can be found in 20*ebfedea0SLionel Sambuc@file{lib/auth}. Presently there are modules for Digital's SIA, 21*ebfedea0SLionel Sambucand IRIX' @code{login} and @code{xdm} (in 22*ebfedea0SLionel Sambuc@file{lib/auth/afskauthlib}). 23*ebfedea0SLionel Sambuc 24*ebfedea0SLionel Sambuc@menu 25*ebfedea0SLionel Sambuc* Digital SIA:: 26*ebfedea0SLionel Sambuc* IRIX:: 27*ebfedea0SLionel Sambuc@end menu 28*ebfedea0SLionel Sambuc 29*ebfedea0SLionel Sambuc@node Digital SIA, IRIX, Authentication modules, Authentication modules 30*ebfedea0SLionel Sambuc@subsection Digital SIA 31*ebfedea0SLionel Sambuc 32*ebfedea0SLionel SambucHow to install the SIA module depends on which OS version you're 33*ebfedea0SLionel Sambucrunning. Tru64 5.0 has a new command, @file{siacfg}, which makes this 34*ebfedea0SLionel Sambucprocess quite simple. If you have this program, you should just be able 35*ebfedea0SLionel Sambucto run: 36*ebfedea0SLionel Sambuc@example 37*ebfedea0SLionel Sambucsiacfg -a KRB5 /usr/athena/lib/libsia_krb5.so 38*ebfedea0SLionel Sambuc@end example 39*ebfedea0SLionel Sambuc 40*ebfedea0SLionel SambucOn older versions, or if you want to do it by hand, you have to do the 41*ebfedea0SLionel Sambucfollowing (not tested by us on Tru64 5.0): 42*ebfedea0SLionel Sambuc 43*ebfedea0SLionel Sambuc@itemize @bullet 44*ebfedea0SLionel Sambuc 45*ebfedea0SLionel Sambuc@item 46*ebfedea0SLionel SambucMake sure @file{libsia_krb5.so} is available in 47*ebfedea0SLionel Sambuc@file{/usr/athena/lib}. If @file{/usr/athena} is not on local disk, you 48*ebfedea0SLionel Sambucmight want to put it in @file{/usr/shlib} or someplace else. If you do, 49*ebfedea0SLionel Sambucyou'll have to edit @file{krb5_matrix.conf} to reflect the new location 50*ebfedea0SLionel Sambuc(you will also have to do this if you installed in some other directory 51*ebfedea0SLionel Sambucthan @file{/usr/athena}). If you built with shared libraries, you will 52*ebfedea0SLionel Sambuchave to copy the shared @file{libkrb.so}, @file{libdes.so}, 53*ebfedea0SLionel Sambuc@file{libkadm.so}, and @file{libkafs.so} to a place where the loader can 54*ebfedea0SLionel Sambucfind them (such as @file{/usr/shlib}). 55*ebfedea0SLionel Sambuc@item 56*ebfedea0SLionel SambucCopy (your possibly edited) @file{krb5_matrix.conf} to @file{/etc/sia}. 57*ebfedea0SLionel Sambuc@item 58*ebfedea0SLionel SambucApply @file{security.patch} to @file{/sbin/init.d/security}. 59*ebfedea0SLionel Sambuc@item 60*ebfedea0SLionel SambucTurn on KRB5 security by issuing @kbd{rcmgr set SECURITY KRB5} and 61*ebfedea0SLionel Sambuc@kbd{rcmgr set KRB5_MATRIX_CONF krb5_matrix.conf}. 62*ebfedea0SLionel Sambuc@item 63*ebfedea0SLionel SambucDigital thinks you should reboot your machine, but that really shouldn't 64*ebfedea0SLionel Sambucbe necessary. It's usually sufficient just to run 65*ebfedea0SLionel Sambuc@kbd{/sbin/init.d/security start} (and restart any applications that use 66*ebfedea0SLionel SambucSIA, like @code{xdm}.) 67*ebfedea0SLionel Sambuc@end itemize 68*ebfedea0SLionel Sambuc 69*ebfedea0SLionel SambucUsers with local passwords (like @samp{root}) should be able to login 70*ebfedea0SLionel Sambucsafely. 71*ebfedea0SLionel Sambuc 72*ebfedea0SLionel SambucWhen using Digital's xdm the @samp{KRB5CCNAME} environment variable isn't 73*ebfedea0SLionel Sambucpassed along as it should (since xdm zaps the environment). Instead you 74*ebfedea0SLionel Sambuchave to set @samp{KRB5CCNAME} to the correct value in 75*ebfedea0SLionel Sambuc@file{/usr/lib/X11/xdm/Xsession}. Add a line similar to 76*ebfedea0SLionel Sambuc@example 77*ebfedea0SLionel SambucKRB5CCNAME=FILE:/tmp/krb5cc`id -u`_`ps -o ppid= -p $$`; export KRB5CCNAME 78*ebfedea0SLionel Sambuc@end example 79*ebfedea0SLionel SambucIf you use CDE, @code{dtlogin} allows you to specify which additional 80*ebfedea0SLionel Sambucenvironment variables it should export. To add @samp{KRB5CCNAME} to this 81*ebfedea0SLionel Sambuclist, edit @file{/usr/dt/config/Xconfig}, and look for the definition of 82*ebfedea0SLionel Sambuc@samp{exportList}. You want to add something like: 83*ebfedea0SLionel Sambuc@example 84*ebfedea0SLionel SambucDtlogin.exportList: KRB5CCNAME 85*ebfedea0SLionel Sambuc@end example 86*ebfedea0SLionel Sambuc 87*ebfedea0SLionel Sambuc@subsubheading Notes to users with Enhanced security 88*ebfedea0SLionel Sambuc 89*ebfedea0SLionel SambucDigital's @samp{ENHANCED} (C2) security, and Kerberos solve two 90*ebfedea0SLionel Sambucdifferent problems. C2 deals with local security, adds better control of 91*ebfedea0SLionel Sambucwho can do what, auditing, and similar things. Kerberos deals with 92*ebfedea0SLionel Sambucnetwork security. 93*ebfedea0SLionel Sambuc 94*ebfedea0SLionel SambucTo make C2 security work with Kerberos you will have to do the 95*ebfedea0SLionel Sambucfollowing. 96*ebfedea0SLionel Sambuc 97*ebfedea0SLionel Sambuc@itemize @bullet 98*ebfedea0SLionel Sambuc@item 99*ebfedea0SLionel SambucReplace all occurrences of @file{krb5_matrix.conf} with 100*ebfedea0SLionel Sambuc@file{krb5+c2_matrix.conf} in the directions above. 101*ebfedea0SLionel Sambuc@item 102*ebfedea0SLionel SambucYou must enable ``vouching'' in the @samp{default} database. This will 103*ebfedea0SLionel Sambucmake the OSFC2 module trust other SIA modules, so you can login without 104*ebfedea0SLionel Sambucgiving your C2 password. To do this use @samp{edauth} to edit the 105*ebfedea0SLionel Sambucdefault entry @kbd{/usr/tcb/bin/edauth -dd default}, and add a 106*ebfedea0SLionel Sambuc@samp{d_accept_alternate_vouching} capability, if not already present. 107*ebfedea0SLionel Sambuc@item 108*ebfedea0SLionel SambucFor each user who does @emph{not} have a local C2 password, you should 109*ebfedea0SLionel Sambucset the password expiration field to zero. You can do this for each 110*ebfedea0SLionel Sambucuser, or in the @samp{default} table. To do this use @samp{edauth} to 111*ebfedea0SLionel Sambucset (or change) the @samp{u_exp} capability to @samp{u_exp#0}. 112*ebfedea0SLionel Sambuc@item 113*ebfedea0SLionel SambucYou also need to be aware that the shipped @file{login}, @file{rcp}, and 114*ebfedea0SLionel Sambuc@file{rshd}, don't do any particular C2 magic (such as checking for 115*ebfedea0SLionel Sambucvarious forms of disabled accounts), so if you rely on those features, 116*ebfedea0SLionel Sambucyou shouldn't use those programs. If you configure with 117*ebfedea0SLionel Sambuc@samp{--enable-osfc2}, these programs will, however, set the login 118*ebfedea0SLionel SambucUID. Still: use at your own risk. 119*ebfedea0SLionel Sambuc@end itemize 120*ebfedea0SLionel Sambuc 121*ebfedea0SLionel SambucAt present @samp{su} does not accept the vouching flag, so it will not 122*ebfedea0SLionel Sambucwork as expected. 123*ebfedea0SLionel Sambuc 124*ebfedea0SLionel SambucAlso, kerberised ftp will not work with C2 passwords. You can solve this 125*ebfedea0SLionel Sambucby using both Digital's ftpd and our on different ports. 126*ebfedea0SLionel Sambuc 127*ebfedea0SLionel Sambuc@strong{Remember}, if you do these changes you will get a system that 128*ebfedea0SLionel Sambucmost certainly does @emph{not} fulfil the requirements of a C2 129*ebfedea0SLionel Sambucsystem. If C2 is what you want, for instance if someone else is forcing 130*ebfedea0SLionel Sambucyou to use it, you're out of luck. If you use enhanced security because 131*ebfedea0SLionel Sambucyou want a system that is more secure than it would otherwise be, you 132*ebfedea0SLionel Sambucprobably got an even more secure system. Passwords will not be sent in 133*ebfedea0SLionel Sambucthe clear, for instance. 134*ebfedea0SLionel Sambuc 135*ebfedea0SLionel Sambuc@node IRIX, , Digital SIA, Authentication modules 136*ebfedea0SLionel Sambuc@subsection IRIX 137*ebfedea0SLionel Sambuc 138*ebfedea0SLionel SambucThe IRIX support is a module that is compatible with Transarc's 139*ebfedea0SLionel Sambuc@file{afskauthlib.so}. It should work with all programs that use this 140*ebfedea0SLionel Sambuclibrary. This should include @command{login} and @command{xdm}. 141*ebfedea0SLionel Sambuc 142*ebfedea0SLionel SambucThe interface is not very documented but it seems that you have to copy 143*ebfedea0SLionel Sambuc@file{libkafs.so}, @file{libkrb.so}, and @file{libdes.so} to 144*ebfedea0SLionel Sambuc@file{/usr/lib}, or build your @file{afskauthlib.so} statically. 145*ebfedea0SLionel Sambuc 146*ebfedea0SLionel SambucThe @file{afskauthlib.so} itself is able to reside in 147*ebfedea0SLionel Sambuc@file{/usr/vice/etc}, @file{/usr/afsws/lib}, or the current directory 148*ebfedea0SLionel Sambuc(wherever that is). 149*ebfedea0SLionel Sambuc 150*ebfedea0SLionel SambucIRIX 6.4 and newer seem to have all programs (including @command{xdm} and 151*ebfedea0SLionel Sambuc@command{login}) in the N32 object format, whereas in older versions they 152*ebfedea0SLionel Sambucwere O32. For it to work, the @file{afskauthlib.so} library has to be in 153*ebfedea0SLionel Sambucthe same object format as the program that tries to load it. This might 154*ebfedea0SLionel Sambucrequire that you have to configure and build for O32 in addition to the 155*ebfedea0SLionel Sambucdefault N32. 156*ebfedea0SLionel Sambuc 157*ebfedea0SLionel SambucApart from this it should ``just work''; there are no configuration 158*ebfedea0SLionel Sambucfiles. 159*ebfedea0SLionel Sambuc 160*ebfedea0SLionel SambucNote that recent Irix 6.5 versions (at least 6.5.22) have PAM, 161*ebfedea0SLionel Sambucincluding a @file{pam_krb5.so} module. Not all relevant programs use 162*ebfedea0SLionel SambucPAM, though, e.g.@: @command{ssh}. In particular, for console 163*ebfedea0SLionel Sambucgraphical login you need to turn off @samp{visuallogin} and turn on 164*ebfedea0SLionel Sambuc@samp{xdm} with @command{chkconfig}. 165*ebfedea0SLionel Sambuc 166*ebfedea0SLionel Sambuc@node AFS, , Authentication modules, Applications 167*ebfedea0SLionel Sambuc@section AFS 168*ebfedea0SLionel Sambuc 169*ebfedea0SLionel Sambuc@cindex AFS 170*ebfedea0SLionel SambucAFS is a distributed filesystem that uses Kerberos for authentication. 171*ebfedea0SLionel Sambuc 172*ebfedea0SLionel Sambuc@cindex OpenAFS 173*ebfedea0SLionel Sambuc@cindex Arla 174*ebfedea0SLionel SambucFor more information about AFS see OpenAFS 175*ebfedea0SLionel Sambuc@url{http://www.openafs.org/} and Arla 176*ebfedea0SLionel Sambuc@url{http://www.stacken.kth.se/projekt/arla/}. 177*ebfedea0SLionel Sambuc 178*ebfedea0SLionel Sambuc@subsection kafs and afslog 179*ebfedea0SLionel Sambuc@cindex afslog 180*ebfedea0SLionel Sambuc 181*ebfedea0SLionel Sambuc@manpage{afslog,1} will obtains AFS tokens for a number of cells. What cells to get 182*ebfedea0SLionel Sambuctokens for can either be specified as an explicit list, as file paths to 183*ebfedea0SLionel Sambucget tokens for, or be left unspecified, in which case will use whatever 184*ebfedea0SLionel Sambucmagic @manpage{kafs,3} decides upon. 185*ebfedea0SLionel Sambuc 186*ebfedea0SLionel SambucIf not told what cell to get credentials for, @manpage{kafs,3} will 187*ebfedea0SLionel Sambucsearch for the files ThisCell and TheseCells in the locations 188*ebfedea0SLionel Sambucspecified in @manpage{kafs,3} and try to get tokens for these cells 189*ebfedea0SLionel Sambucand the cells specified in $HOME/.TheseCells. 190*ebfedea0SLionel Sambuc 191*ebfedea0SLionel SambucMore usefully it will look at and ~/.TheseCells in your home directory 192*ebfedea0SLionel Sambucand for each line which is a cell get afs token for these cells. 193*ebfedea0SLionel Sambuc 194*ebfedea0SLionel SambucThe TheseCells file defines the the cells to which applications on the 195*ebfedea0SLionel Sambuclocal client machine should try to aquire tokens for. It must reside in 196*ebfedea0SLionel Sambucthe directories searched by @manpage{kafs,3} on every AFS client machine. 197*ebfedea0SLionel Sambuc 198*ebfedea0SLionel SambucThe file is in ASCII format and contains one character string, the cell 199*ebfedea0SLionel Sambucname, per line. Cell names are case sensitive, but most cell names 200*ebfedea0SLionel Sambucare lower case. 201*ebfedea0SLionel Sambuc 202*ebfedea0SLionel SambucSee manpage for @manpage{kafs,3} for search locations of ThisCell and TheseCells. 203*ebfedea0SLionel Sambuc 204*ebfedea0SLionel Sambuc@subsection How to get a KeyFile 205*ebfedea0SLionel Sambuc 206*ebfedea0SLionel Sambuc@file{ktutil -k AFSKEYFILE:KeyFile get afs@@MY.REALM} 207*ebfedea0SLionel Sambuc 208*ebfedea0SLionel Sambucor you can extract it with kadmin 209*ebfedea0SLionel Sambuc 210*ebfedea0SLionel Sambuc@example 211*ebfedea0SLionel Sambuckadmin> ext -k AFSKEYFILE:/usr/afs/etc/KeyFile afs@@My.CELL.NAME 212*ebfedea0SLionel Sambuc@end example 213*ebfedea0SLionel Sambuc 214*ebfedea0SLionel SambucYou have to make sure you have a @code{des-cbc-md5} encryption type since that 215*ebfedea0SLionel Sambucis the enctype that will be converted. 216*ebfedea0SLionel Sambuc 217*ebfedea0SLionel Sambuc@subsection How to convert a srvtab to a KeyFile 218*ebfedea0SLionel Sambuc 219*ebfedea0SLionel SambucYou need a @file{/usr/vice/etc/ThisCell} containing the cellname of your 220*ebfedea0SLionel SambucAFS-cell. 221*ebfedea0SLionel Sambuc 222*ebfedea0SLionel Sambuc@file{ktutil copy krb4:/root/afs-srvtab AFSKEYFILE:/usr/afs/etc/KeyFile}. 223*ebfedea0SLionel Sambuc 224*ebfedea0SLionel SambucIf keyfile already exists, this will add the new key in afs-srvtab to 225*ebfedea0SLionel SambucKeyFile. 226*ebfedea0SLionel Sambuc 227*ebfedea0SLionel Sambuc@section Using 2b tokens with AFS 228*ebfedea0SLionel Sambuc 229*ebfedea0SLionel Sambuc@subsection What is 2b ? 230*ebfedea0SLionel Sambuc 231*ebfedea0SLionel Sambuc2b is the name of the proposal that was implemented to give basic 232*ebfedea0SLionel SambucKerberos 5 support to AFS in rxkad. It's not real Kerberos 5 support 233*ebfedea0SLionel Sambucsince it still uses fcrypt for data encryption and not Kerberos 234*ebfedea0SLionel Sambucencryption types. 235*ebfedea0SLionel Sambuc 236*ebfedea0SLionel SambucIts only possible (in all cases) to do this for DES encryption types 237*ebfedea0SLionel Sambucbecause only then the token (the AFS equivalent of a ticket) will be 238*ebfedea0SLionel Sambucsmaller than the maximum size that can fit in the token cache in the 239*ebfedea0SLionel SambucOpenAFS/Transarc client. It is a so tight fit that some extra wrapping 240*ebfedea0SLionel Sambucon the ASN1/DER encoding is removed from the Kerberos ticket. 241*ebfedea0SLionel Sambuc 242*ebfedea0SLionel Sambuc2b uses a Kerberos 5 EncTicketPart instead of a Kerberos 4 ditto for 243*ebfedea0SLionel Sambucthe part of the ticket that is encrypted with the service's key. The 244*ebfedea0SLionel Sambucclient doesn't know what's inside the encrypted data so to the client 245*ebfedea0SLionel Sambucit doesn't matter. 246*ebfedea0SLionel Sambuc 247*ebfedea0SLionel SambucTo differentiate between Kerberos 4 tickets and Kerberos 5 tickets, 2b 248*ebfedea0SLionel Sambucuses a special kvno, 213 for 2b tokens and 255 for Kerberos 5 tokens. 249*ebfedea0SLionel Sambuc 250*ebfedea0SLionel SambucIts a requirement that all AFS servers that support 2b also support 251*ebfedea0SLionel Sambucnative Kerberos 5 in rxkad. 252*ebfedea0SLionel Sambuc 253*ebfedea0SLionel Sambuc@subsection Configuring a Heimdal kdc to use 2b tokens 254*ebfedea0SLionel Sambuc 255*ebfedea0SLionel SambucSupport for 2b tokens in the kdc are turned on for specific principals 256*ebfedea0SLionel Sambucby adding them to the string list option @code{[kdc]use_2b} in the 257*ebfedea0SLionel Sambuckdc's @file{krb5.conf} file. 258*ebfedea0SLionel Sambuc 259*ebfedea0SLionel Sambuc@example 260*ebfedea0SLionel Sambuc[kdc] 261*ebfedea0SLionel Sambuc use_2b = @{ 262*ebfedea0SLionel Sambuc afs@@SU.SE = yes 263*ebfedea0SLionel Sambuc afs/it.su.se@@SU.SE = yes 264*ebfedea0SLionel Sambuc @} 265*ebfedea0SLionel Sambuc@end example 266*ebfedea0SLionel Sambuc 267*ebfedea0SLionel Sambuc@subsection Configuring AFS clients for 2b support 268*ebfedea0SLionel Sambuc 269*ebfedea0SLionel SambucThere is no need to configure AFS clients for 2b support. The only 270*ebfedea0SLionel Sambucsoftware that needs to be installed/upgrade is a Kerberos 5 enabled 271*ebfedea0SLionel Sambuc@file{afslog}. 272