OpenAFS with MIT Kerberos

AFS is a distributed network filesystem that also allows for replication. Organizations such as Google and the Internet Archive have been known to use AFS (along with Linux) for its scalability.

From http://www.openafs.org:

''AFS is a distributed filesystem product, pioneered at Carnegie Mellon University and supported and developed as a product by Transarc Corporation (now IBM Pittsburgh Labs). It offers a client-server architecture for file sharing, providing location independence, scalability, security, and transparent migration capabilities for data.''

''IBM branched the source of the AFS product, and made a copy of the source available for community development and maintenance. They called the release OpenAFS.''

Kerberos offers a network authentication protocol for use in client/server network topologies. AFS originally implemented a version of Kerberos for its authentication purposes and was based on the Kerberos v4 protocol. However, since DES is no longer approved for Federal use, organizations are replacing AFS's authentication server (kaserver) with a Kerberos v5 authentication server.

Kerberos Installation
The first step is to install kerberos on the server and setup a KDC

Since there can be more than one kerberos server working together, kerberos breaks servers into logical groups called realms. Kerberos realms are always uppercase, and by convention consist of your domain. You will need to select a name for your realm, and add to the file on your server:

replace "EXAMPLE.COM" above with your kerberos realm, "example.com" with your domain, and "server.example.com" with your server.

This same file will need to be copied to clients who need to access your kerberos server.

Primary KDC
Next, you'll need to create the Key Distribution Center (KDC) which is responsible for housing Kerberos principals, passwords and access control lists.

Now create a directory for storing the KDC files and databases:

Now you must create the file. This will contain the details for how your KDC will run.

Edit this file replacing the given realm with your own, and specifying the path you used above if it differs from. You can edit the other options if you know what you are doing or have some special need. The manpage has more information about the file:

In order to allow your database to be editable, you need to give principals access to it. This is done through the file in the directory you created above. The most basic configuration allows all principals that have an instance name of admin (ends in /admin) access to everything:

A more secure way that requires more maintenance is to list the principals that will have access:

See the kadmind man page for more detail if you need a more complex setup:

Now you are ready to initialize the kerberos database.

don't forget to replace EXAMPLE.COM with your realm name.

Principal Creation
At this point you should test your Kerberos installation by creating an admin principal for kerberos and afs administration. You may call it whatever you like.

Now create a principal for afs itself. You will never use this principal, it's for afs only, so we use to generate a random key that can be used by afs.

The example.com above is the afs cell name. Similar to a kerberos realm, an afs cell is a logical grouping of afs servers. Convention dictates that you should name your cell after your kerberos realm, but in lowercase, since afs cell names are always lowercase.

Each afs server needs to have the key that was generated in the last step, so we export it here:

It is important to remember (or write down) the key version number (kvno) that this command gives in its output, you will need it later.

Start Kerberos Servers
You are now ready to start the kerberos kdc and kadmin server.

Set them to start at boot:

Now that kadmind and the kdc is running, you can use kadmind instead of kadmind.local.

OpenAFS Server
You will now need to install :

Configure AFS Cell info
You will need to edit several files in to set up your new afs cell.

Put this info in the client configurations too:

Now that your configurations are correct, you can tell afs what kerberos principal it needs to use, and what key to use to authenticate:

The 3 above should be replaced with the kvno from earlier.

Bos and Other AFS Servers
BOS is the Basic OverSeer Server. It coordinates and starts all of the other afs servers. First you need to start the bosserver manually without authentication in order to set the server up.

Now that the bosserver is running, you can have it start and configure the protection server (for user accounts) and the volume location server:

with these started you can add your admin user to the afs user database and make it an afs admin:

Setup the final few services:

Stop the temporary (and insecure) bosserver:

/vicepx partitions
The afs fileserver stores its volumes on partitions mounted in the root directory as, , etc. Before you start the afs server through the initscripts, you should create and mount a partition at.

Starting the openafs server
You are now ready to start the OpenAFS server for the first time:

To have it start at boot, which you probably want:

OpenAFS File Structure
In order to set up the file structure, a client has to run that can connect to your server. It is easiest to do this if the client is run on the server, as it will help while setting things up.

Starting the client
Before starting the client for the first time, it is necessary to disable DYN_ROOT, in order to set up the root.afs volume:

Start the client:

Create Basic volume framework
Authenticate to kerberos:

Use the kerberos authentication to authenticate to afs:

You can now run commands as the afs admin. You need to create the root.afs volume which when DYN_ROOT is disabled, is normally mounted on

With DYN_ROOT disabled, you can now make /afs readable to everyone with:

Now you can create the root volume for your cell (which will be the basis for your whole AFS File Structure):

Mount it on :

Make sure your cell's contents are readable too:

Mount a read-write copy on :

Other volumes can be mounted underneath the root of your cell in the same way, if you wish.

Congratulations, you now have a full AFS server!

Restarting the client
You may want to set DYN_ROOT back to yes:

You then need to restart your client:

AFS/Kerberos Enabled Login
In order to authenticate to kerberos and get an afs token when logging in, you need to install and configure and :

You will also need to edit your PAM configuration files. It should look something like this when you are done: