Kerberos

 in
Mr. Leipold explains what Kerberos is and why you want to use it.

Kerberos is a powerful set of programs which allow you to have encrypted connections to virtually anything: TELNET, FTP and even e-mail. This is of little use to the modem user, but in larger settings where Ethernet is used and sniffing is a real danger, Kerberos provides a viable and powerful solution. There is, however, one problem—Kerberos is notoriously known for being overly complex and difficult to install. This article is designed to help you make a good start; before you know it, with a little experimentation everything will (kind of) work. I wish I could explain everything in detail here, but then, this would be a book, not an article.

Here Comes Disaster

Like almost every major upgrade/change, it would be ideal to make a backup of your system. If you can, do it. If you don't have a tape drive be careful installing, Kereberos shouldn't write over your files, but if you want to be sure, make copies of /sbin somewhere. It takes two seconds and if something goes wrong it will be well worth your time.

Now we go grab the files. There are binary and source distributions of Kerberos for Linux. I've found that the source usually causes me less problems than the binaries. If you are up to playing around a bit go ahead and get the source, otherwise grab the binaries. Either can be found at http://web.mit.edu/kerberos/www/. I'll cover only the binaries here—simply because compiling the source isn't part of the scope of this article. I'm going to assume you managed to install things right. One important note: If you do choose to use the source (I recommend you do) make sure you extract all the tar archive files, not just the one containing the source. Also, if you install things in a different directory (not /krb5) then you will need to modify the files mentioned below to reflect your installation directory.

Two Files: /etc/krb5.conf and kdc.conf

These two files control virtually everything. They control the name of your REALM (see below) and who can connect; however, they can be fairly complex. Before you set them up, you will probably need to understand a few terms:

  • REALM: I think of a realm as a “group”. Machines will belong to this group. It has become almost standard procedure to make the realm the same as your domain name, just with capital letters. In my case, I called it UNDER, but you could call it anything you wanted. Yes, you can have more than one REALM, but you probably won't need one. Remember—the REALM is case sensitive! Pick a standard and stick to it.

  • KEYTAB: a file that contains encrypted information allowing users/machines to authenticate themselves. Each machine that attempts to authenticate itself to the KDC (see below) must have one. This is done by issuing the ktadd command under kadmin.

  • KDC: the Kerberos Distribution Center—the one that causes you headaches. This is the machine that controls access.

  • PRINCIPAL: a principal is a “definition” of a user or a host. It is, effectively, what tells the server a user exists or a server is trusted.

  • INCIDENT: when making a new principal, the notation is as follows: incident/host@REALM. For example, with ktadd, doing something like

        ktadd host/pepsi.kellogg.nwu.edu@UNDER
  • would make the incident host for the machine pepsi.kellogg.nwu.edu which is part of the UNDER realm.

Listing 1

Take a look at my /etc/krb5.conf file and notice the following:

  • default_realm = UNDER: name of your realm.

  • profile = /krb5/var/krb5kdc/kdc.conf: location of your kdc.conf file

Also note the section called [realms]. Under it, I have the name of my realm, UNDER, and the machine that hosts that information, in this case, underground.kellogg.nwu.edu. This will be the hostname of where you just installed Kerberos. [domain_realm] explains who can connect to the realm: anyone from anywhere within kellogg and within res-hall (the dorm rooms at Northwestern). Replace all the information mentioned above with the name of your REALM and the name of the machine you installed the server on.

Listing 2

Now on to your kdc.conf file. You are going to need to place it wherever you defined it in /etc/krb5.conf. My suggestion is you place it in the same directory I did. This will mean making these directories. If you do that, you can just copy my kdc.conf and save yourself some time. Just change the name of the realm to whatever you picked when making krb5.conf file. These two files are integral to making things work. You may want to double check for typos and possibly save yourself some headaches later.

Now, some tedious but easy work must be done. Create the database that controls who can login where by issuing the following command:

# kdb5_util create -r
Initializing database '/krb5/lvar/krb5kdc/principal' for
  realm '
master key name 'K/M@YOUR_REALM'

In my case, YOUR_REALM would have been UNDER. Just replace it with whatever the host name of the machine you are on right now is. You will be asked for a master password; pick something you won't forget.

Now you must make an ACL file. This basically controls who can connect and administer the REALM. It can also be complex, but for our purposes we will keep it simple. Edit the file (or create) defined by acl = in the kdc.conf file. Place the following on a line by itself:

*/admin@

This means the administrator can control things. I don't see why you would want anything else anyway.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState