Applications
************

Authentication modules
======================

The problem of having different authentication mechanisms has been recognised by several vendors, and several solutions have appeared. In most cases these solutions involve some kind of shared modules that are loaded at run-time.  Modules for some of these systems can be found in lib/auth.  Presently there are modules for Digital's SIA, and IRIX' login and xdm (in lib/auth/afskauthlib).

Digital SIA
-----------

How to install the SIA module depends on which OS version you're running. Tru64 5.0 has a new command, siacfg, which makes this process quite simple. If you have this program, you should just be able to run:

     siacfg -a KRB5 /usr/athena/lib/libsia_krb5.so

On older versions, or if you want to do it by hand, you have to do the following (not tested by us on Tru64 5.0):

  * Make sure libsia_krb5.so is available in /usr/athena/lib. If /usr/athena is not on local disk, you might want to put it in /usr/shlib or someplace else. If you do, you'll have to edit krb5_matrix.conf to reflect the new location (you will also have to do this if you installed in some other directory than /usr/athena). If you built with shared libraries, you will have to copy the shared libkrb.so, libdes.so, libkadm.so, and libkafs.so to a place where the loader can find them (such as /usr/shlib).

  * Copy (your possibly edited) krb5_matrix.conf to /etc/sia.

  * Apply security.patch to /sbin/init.d/security.

  * Turn on KRB5 security by issuing rcmgr set SECURITY KRB5 and rcmgr set KRB5_MATRIX_CONF krb5_matrix.conf.

  * Digital thinks you should reboot your machine, but that really shouldn't be necessary.  It's usually sufficient just to run /sbin/init.d/security start (and restart any applications that use SIA, like xdm.)

Users with local passwords (like root) should be able to login safely.

When using Digital's xdm the KRB5CCNAME environment variable isn't passed along as it should (since xdm zaps the environment). Instead you have to set KRB5CCNAME to the correct value in /usr/lib/X11/xdm/Xsession. Add a line similar to

     KRB5CCNAME=FILE:/tmp/krb5cc`id -u`_`ps -o ppid= -p $$`; export KRB5CCNAME

If you use CDE, dtlogin allows you to specify which additional environment variables it should export. To add KRB5CCNAME to this list, edit /usr/dt/config/Xconfig, and look for the definition of exportList. You want to add something like:

     Dtlogin.exportList:     KRB5CCNAME

Notes to users with Enhanced security
.....................................

Digital's ENHANCED (C2) security, and Kerberos solve two different problems. C2 deals with local security, adds better control of who can do what, auditing, and similar things. Kerberos deals with network security.

To make C2 security work with Kerberos you will have to do the following.

  * Replace all occurrences of krb5_matrix.conf with krb5+c2_matrix.conf in the directions above.

  * You must enable ``vouching'' in the default database.  This will make the OSFC2 module trust other SIA modules, so you can login without giving your C2 password. To do this use edauth to edit the default entry /usr/tcb/bin/edauth -dd default, and add a d_accept_alternate_vouching capability, if not already present.

  * For each user who does not have a local C2 password, you should set the password expiration field to zero. You can do this for each user, or in the default table. To do this use edauth to set (or change) the u_exp capability to u_exp#0.

  * You also need to be aware that the shipped login, rcp, and rshd, don't do any particular C2 magic (such as checking for various forms of disabled accounts), so if you rely on those features, you shouldn't use those programs. If you configure with --enable-osfc2, these programs will, however, set the login UID. Still: use at your own risk.

At present su does not accept the vouching flag, so it will not work as expected.

Also, kerberised ftp will not work with C2 passwords. You can solve this by using both Digital's ftpd and our on different ports.

Remember, if you do these changes you will get a system that most certainly does not fulfil the requirements of a C2 system. If C2 is what you want, for instance if someone else is forcing you to use it, you're out of luck.  If you use enhanced security because you want a system that is more secure than it would otherwise be, you probably got an even more secure system. Passwords will not be sent in the clear, for instance.

IRIX
----

The IRIX support is a module that is compatible with Transarc's afskauthlib.so.  It should work with all programs that use this library. This should include login and xdm.

The interface is not very documented but it seems that you have to copy libkafs.so, libkrb.so, and libdes.so to /usr/lib, or build your afskauthlib.so statically.

The afskauthlib.so itself is able to reside in /usr/vice/etc, /usr/afsws/lib, or the current directory (wherever that is).

IRIX 6.4 and newer seem to have all programs (including xdm and login) in the N32 object format, whereas in older versions they were O32. For it to work, the afskauthlib.so library has to be in the same object format as the program that tries to load it. This might require that you have to configure and build for O32 in addition to the default N32.

Apart from this it should ``just work''; there are no configuration files.

Note that recent Irix 6.5 versions (at least 6.5.22) have PAM, including a pam_krb5.so module.  Not all relevant programs use PAM, though, e.g. ssh. In particular, for console graphical login you need to turn off visuallogin and turn on xdm with chkconfig.

AFS
===

AFS is a distributed filesystem that uses Kerberos for authentication.

For more information about AFS see OpenAFS http://www.openafs.org/ and Arla http://www.stacken.kth.se/projekt/arla/.

kafs and afslog
---------------

afslog,1 will obtains AFS tokens for a number of cells. What cells to get tokens for can either be specified as an explicit list, as file paths to get tokens for, or be left unspecified, in which case will use whatever magic kafs,3 decides upon.

If not told what cell to get credentials for, kafs,3 will search for the files ThisCell and TheseCells in the locations specified in kafs,3 and try to get tokens for these cells and the cells specified in $HOME/.TheseCells.

More usefully it will look at and ~/.TheseCells in your home directory and for each line which is a cell get afs token for these cells.

The TheseCells file defines the the cells to which applications on the local client machine should try to aquire tokens for. It must reside in the directories searched by kafs,3 on every AFS client machine.

The file is in ASCII format and contains one character string, the cell name, per line. Cell names are case sensitive, but most cell names are lower case.

See manpage for kafs,3 for search locations of ThisCell and TheseCells.

How to get a KeyFile
--------------------

ktutil -k AFSKEYFILE:KeyFile get afs@MY.REALM

or you can extract it with kadmin

     kadmin> ext -k AFSKEYFILE:/usr/afs/etc/KeyFile afs@My.CELL.NAME

You have to make sure you have a des-cbc-md5 encryption type since that is the enctype that will be converted.

How to convert a srvtab to a KeyFile
------------------------------------

You need a /usr/vice/etc/ThisCell containing the cellname of your AFS-cell.

ktutil copy krb4:/root/afs-srvtab AFSKEYFILE:/usr/afs/etc/KeyFile.

If keyfile already exists, this will add the new key in afs-srvtab to KeyFile.

Using 2b tokens with AFS
========================

What is 2b ?
------------

2b is the name of the proposal that was implemented to give basic Kerberos 5 support to AFS in rxkad. It's not real Kerberos 5 support since it still uses fcrypt for data encryption and not Kerberos encryption types.

Its only possible (in all cases) to do this for DES encryption types because only then the token (the AFS equivalent of a ticket) will be smaller than the maximum size that can fit in the token cache in the OpenAFS/Transarc client. It is a so tight fit that some extra wrapping on the ASN1/DER encoding is removed from the Kerberos ticket.

2b uses a Kerberos 5 EncTicketPart instead of a Kerberos 4 ditto for the part of the ticket that is encrypted with the service's key. The client doesn't know what's inside the encrypted data so to the client it doesn't matter.

To  differentiate between Kerberos 4 tickets and Kerberos 5 tickets, 2b uses a special kvno, 213 for 2b tokens and 255 for Kerberos 5 tokens.

Its a requirement that all AFS servers that support 2b also support native Kerberos 5 in rxkad.

Configuring a Heimdal kdc to use 2b tokens
------------------------------------------

Support for 2b tokens in the kdc are turned on for specific principals by adding them to the string list option [kdc]use_2b in the kdc's krb5.conf file.

     [kdc]
     	use_2b = {
     		afs@SU.SE = yes
     		afs/it.su.se@SU.SE = yes
     	}

Configuring AFS clients for 2b support
--------------------------------------

There is no need to configure AFS clients for 2b support. The only software that needs to be installed/upgrade is a Kerberos 5 enabled afslog.