Configuring Heimdal Config files /etc/krb5.conf and /var/lib/krb5kdc/kdc.conf Configuration Information Kerberos Configuration Create the Kerberos configuration file with the following command: cat > /etc/krb5.conf << "EOF" # Begin /etc/heimdal/krb5.conf [libdefaults] default_realm = [LFS.ORG] encrypt = true [realms] [LFS.ORG] = { kdc = [] admin_server = [] } [domain_realm] .[] = [LFS.ORG] [logging] kdc = SYSLOG[:INFO[:AUTH]] admin_server = SYSLOG[INFO[:AUTH]] default = SYSLOG[[:SYS]] # End /etc/heimdal/krb5.conf EOF You will need to substitute your domain and proper hostname for the occurances of the belgarath and names. default_realm should be the name of your domain changed to ALL CAPS. This isn't required, but both Heimdal and MIT recommend it. encrypt = true provides encryption of all traffic between kerberized clients and servers. It's not necessary and can be left off. If you leave it off, you can encrypt all traffic from the client to the server using a switch on the client program instead. The [realms] parameters tell the client programs where to look for the KDC authentication services. The [domain_realm] section maps a domain to a realm. Create the KDC database: kdb5_util create -r [LFS.ORG] -s Now we need to populate the database with principles (users). For now, just use your regular login name or root. kadmin.local kadmin:addprinc [loginname] The KDC server and any machine running kerberized server daemons must have a host key installed: kadmin:addprinc --random-key host/[] After choosing the defaults when prompted, you will have to export the data to a keytab file: kadmin:ktadd host/[] This should have created a file in /etc named krb5.keytab (Kerberos 5). This file should have 600 (root rw only) permissions. Keeping the keytab files from public access is crucial to the overall security of the Kerberos installation. Eventually, you'll want to add server daemon principles to the database and extract them to the keytab file. You do this in the same way you created the host principles. Below is an example: kadmin:add --random-key ftp/[] kadmin:ktadd ftp/[] Exit the kadmin program (use quit or exit) and return back to the shell prompt. Start the KDC daemon manually, just to test out the installation: /usr/sbin/krb5kdc & Attempt to get a ticket with the following command: kinit [loginname] You will be prompted for the password you created. After you get your ticket, you can list it with the following command: klist Information about the ticket should be displayed on the screen. To test the functionality of the keytab file, issue the following command: ktutil ktutil:rkt /etc/krb5.keytab ktutil:l This should dump a list of the host principal, along with the encryption methods used to access the principal. At this point, if everything has been successful so far, you can feel fairly confident in the installation and configuration of the package. To automate the running of Kerberos server, use the following command to create the init.d script: cat >etc/rc.d/init.d/kerberos << "EOF" #!/bin/sh # Begin $rc_base/init.d/kerberos # Based on sysklogd script from LFS-3.1 and earlier. # Rewritten by Gerard Beekmans - . /etc/sysconfig/rc . $rc_functions case "$1" in start) echo "Starting Kerberos Authentication..." loadproc krb5kdc echo "Starting Kerberos Admin Daemon..." loadproc kadmind ;; stop) echo "Stopping Kerberos Authentication..." killproc krb5kdc echo "Stopping Kerberos Admin Daemon..." killproc kadmind ;; reload) echo "Reloading Kerberos Authentication..." reloadproc krb5kdc echo "Reloading Kerberos Admin Daemon..." reloadproc kadmind ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc ;; *) echo "Usage: $0 {start|stop|reload|restart|status}" exit 1 ;; esac # End $rc_base/init.d/kerberos EOF chmod 754 /etc/rc.d/init.d/kerberos Create the symbolic links to this file in the relevant rc.d directory with the following commands: cd /etc/rc.d/init.d && ln -sf ../init.d/kerberos ../rc0.d/K42kerberos && ln -sf ../init.d/kerberos ../rc1.d/K42kerberos && ln -sf ../init.d/kerberos ../rc2.d/K42kerberos && ln -sf ../init.d/kerberos ../rc3.d/S28kerberos && ln -sf ../init.d/kerberos ../rc4.d/S28kerberos && ln -sf ../init.d/kerberos ../rc5.d/S28kerberos && ln -sf ../init.d/kerberos ../rc6.d/K42kerberos Using Kerberized Client Programs To use the kerberized client programs (telnet, ftp, rsh, rcp, rlogin), you first must get an authentication ticket. Use the kinit program to get the ticket. After you've acquired the ticket, you can use the kerberized programs to connect to any kerberized server on the network. You will not be prompted for authentication until your ticket expires (default is one day), unless you specify a different user as a command line argument to the program. The kerberized programs will connect to non kerberized daemons, warning you that authentication is not encrypted. For additional information consult Documentation for krb-&mitkrb-version; on which the above instructions are based.