<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<!DOCTYPE article PUBLIC "-//Oasis//DTD DocBook V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">

<article>
<articleinfo>
<title>Making your Ubuntu or Debian box Athena-ish</title>
</articleinfo>

<warning>
<title>Debian-Athena</title>

<para>In 2006, SIPB completed a new <ulink
url="http://debathena.mit.edu/">Debian-Athena</ulink> project, which
offers almost all Athena services as Debian packages, so that one does
not have to do the configuration work described below.  That should
make most of this page obsolete.</para>
</warning>

<sect1><title>About this document</title>
<para>
This page is intended to document to process of integrating an Ubuntu or Debian GNU/Linux machine into the Athena environment. This will NOT make a true Athena workstation. However, most of the critical Athena services (Kerberos, AFS, Zephyr) have been ported to Debian.
</para>
<para>
This document assumes a basic familiarity with Ubuntu or Debian, the GNU Toolchain, and Athena. Also, dependencies are not listed.
</para>

<para>
The original Docbook XML for this document can be found <ulink url="index.xml">here</ulink>.
</para>

<sect2><title>How to use this document </title>

<para>
Text like this contains instructions, explanations and comments.
</para>

<screen>
Text like this is meant to be executed. It generally can
be copied as a block and pasted into a command prompt.
Some times you may want to copy them into a text editor
and edit them first.
</screen>
<programlisting>
Text like this is meant to be inserted into a file. Use
your favorite text editor.
</programlisting>
</sect2>
</sect1>
<sect1><title>Making your Ubuntu or Debian box Athena-ish</title>

<sect2><title> Ubuntu Repositories </title>

In Ubuntu, you may need to add the <userinput>universe</userinput>
repository to your <filename>/etc/apt/sources.list</filename> file by
uncommenting the appropriate lines.

</sect2>

<sect2><title> Kerberos </title>

<warning>
<title>WARNING</title>
<para>
The Kerberos 4 protocol has several well documented cryptographic vulerabilites.
</para>
</warning>

<screen>
<command>apt-get install ssh-krb5 krb5-user krb4-config</command>
</screen>

On Ubuntu:

<screen>
<command>dpkg-reconfigure krb5-config krb4-config</command>
</screen>

<para> Use <userinput>ATHENA.MIT.EDU</userinput> as your Kerberos
realm. </para> To enable passwordless SSH using Kerberos tickets, add
the following lines to your <filename>/etc/ssh/ssh_config</filename>
file:

<programlisting>
GSSAPIAuthentication yes
GSSAPIDelegateCredentials yes
</programlisting>

</sect2>

<sect2><title> Kerberos Login </title>

For users who have local accounts, it's possible to set up your system
to get Kerberos tickets and AFS tokens on login.

<screen>
<command>apt-get install libpam-krb5 libpam-openafs-session</command>
</screen>

Edit <filename>/etc/pam.d/common-auth</filename> so that it contains:

<programlisting>
auth    sufficient      pam_unix.so nullok_secure
auth    sufficient      pam_krb5.so use_first_pass forwardable
</programlisting>

Edit <filename>/etc/pam.d/common-session</filename> to:

<programlisting>
session         required        pam_unix.so
session         optional        pam_krb5.so
session         optional        pam_openafs_session.so
</programlisting>

After making these changes, restart ssh-krb5 by running 

<screen>
<command>/etc/init.d/ssh-krb5 restart</command>
</screen>

You can now login with either your Kerberos password or your local
password.  If you use your Kerberos password, you will get both
Kerberos tickets and AFS tokens automatically.  If you want to be able
to login to your machine using Kerberos ticket forwarding, then you
should request a keytab from Athena Accounts and put it at <code
class="filename">/etc/krb5.keytab </code>

You will not get Kerberos 4 tickets on login, since there is no PAM
module to get them.  There are a few ways to deal with this, depending
on your situation.  One is to add 

<screen>
<command>krb524init</command>
</screen>

to your login dotfiles (<code class="filename">~/.profile</code> or
<code class="filename">~/.login</code>, or the corresponding
system-wide files <code class="filename">/etc/profile</code> or <code
class="filename">/etc/csh.login</code>). 

</sect2>

<sect2><title> AFS </title>

<sect3><title>AFS Kernel Module</title>
<para> AFS installation requires building kernel modules. </para>

<para> If you wish to use a Debian stock kernel (recommended), run the
following commands, and then proceed to the section on the AFS client. </para>

<screen>
<command>apt-get install module-assistant build-essential gcc-3.4 openafs-modules-source</command>
<command>module-assistant prepare</command>
<command>module-assistant auto-install openafs-modules</command>
<command>depmod -a</command>
</screen>


<para> If you instead wish to compile your own kernel, run the following commands. Substitute in the version of the kernel source you wish to use.</para>

<screen>
<command>apt-get install kernel-package build-essential \</command>
<command>linux-source-<replaceable>2.6.12</replaceable> openafs-modules-source</command>
<command>cd /usr/src ; tar -xzf openafs.tar.gz</command>
<command>tar -xjf linux-source-<replaceable>2.6.12</replaceable>.tar.bz2</command>
<command>ln -s linux-source-<replaceable>2.6.12</replaceable> linux</command>
<command>cd linux ; make menuconfig</command>
</screen>

<para> Configure the kernel as you like, and then run following commands. Feel free to change <replaceable>foo1</replaceable> to any other valid revision name.</para>

<screen>
<command>make-kpkg --rev <replaceable>foo1</replaceable> kernel_image</command>
<command>make-kpkg modules_image</command>
<command>cd .. ; dpkg -i *<replaceable>foo1</replaceable>*.deb</command>
</screen>

<para>
Reboot and make sure your kernel works and the openafs modules are installed correctly.
</para>
</sect3>
<sect3><title>AFS Client</title>
In order to use AFS, you will also need ot install and configure the
client packages.  
<screen>
<command>apt-get install openafs-client openafs-krb5</command>
</screen>

On Ubuntu:

<screen>
<command>dpkg-reconfigure openafs-client</command>
</screen>

<para>
Use <userinput>athena.mit.edu</userinput> as your cell. Dynroot, encrypted traffic, fakestat and DNS lookups are all recommended.
</para>
</sect3>
</sect2>

<sect2><title> NTP </title>

<screen>
<command>apt-get install ntp-simple ntpdate</command>
</screen>

<para>
Edit <filename>/etc/ntp.conf</filename> and add the following line before any other timeserver listings.
</para>

<programlisting>
server time.mit.edu
</programlisting>
</sect2>

<sect2><title> Zephyr </title>

<screen>
<command>apt-get install libzephyr3-krb zephyr-clients</command>
</screen>

<para>
Enter <userinput>neskaya.mit.edu arilinn.mit.edu</userinput> as your zephyr servers.
</para>

<para>
If you are behind a firewall or router using Network Address Translation (NAT), Zephyr will not work. The Zephyr protocol is known to be incompatible with NAT.
</para>
</sect2>

<sect2><title> Hesiod </title>

<screen>
<command>apt-get install hesiod</command>
</screen>

Edit the line in <filename>/etc/hesiod.conf</filename> that starts
with <userinput>rhs=</userinput> to:

<programlisting>
rhs=.athena.mit.edu
</programlisting>

</sect2>

<sect2><title> Printing </title>

<screen>
<command>apt-get install lprng</command>
</screen>

<para>
Copy Athena's <filename>/usr/athena/libexec/get_hesiod_pcap</filename> to <filename>/usr/local/bin</filename>.
</para>

<para>
Edit <filename>get_hesiod_pcap</filename> so the path line reads as follows.
</para>

<programlisting>
PATH=/usr/bin:/bin
</programlisting>

<para>
If possible, paste the following commands as a block into the command prompt.
</para>

<screen>
<command>mv /etc/lprng/lpd.conf /etc/lprng/lpd.conf.orig</command>

<command>cat > /etc/lprng/lpd.conf &lt;&lt; "EOF"</command>
force_localhost@
kerberos_service=daemon
printcap_path=/etc/printcap:|/usr/local/bin/get_hesiod_pcap
reuse_addr
use_date@
retry_econnrefused@
EOF

<command>touch /etc/printcap</command>
<command>/etc/init.d/lprng restart</command>
</screen>
</sect2>

<sect2><title><filename>/mit</filename> Automounter</title>

<screen>
<command>apt-get install autofs autofs-hesiod</command>
</screen>

<para>
Add the following line to <filename>/etc/auto.master</filename>.
</para>

<programlisting>
/mit     hesiod
</programlisting>

<screen>
<command>/etc/init.d/autofs restart</command>
</screen>
</sect2>


<sect2><title>A Few Suggestions</title>

<para>
If you plan on traveling outside of MIT with this computer, you will need to make changes in order to have web, student, and other abbreviations of MIT domains still resolve to the MIT sites.
</para>

<para>
If you are using DHCP, add the following line to <filename>/etc/dhclient.conf</filename>.
</para>


<programlisting>
supersede domain-name "mit.edu";
</programlisting>

<para>
If you are using a static IP while away from MIT, add the following line to <filename>/etc/resolv.conf</filename>.
</para>

<programlisting>
search mit.edu
</programlisting>

<para>
In order to run several programs kept in AFS lockers you must have the script <filename>afslocker</filename> in <filename>/usr/bin</filename>. <!--Here is a version of <ulink url="http://mit.edu/zacheiss/openafs-installer/afslocker">afslocker</ulink> which may or may not work-->. Because of the way the automounter works, <filename>/usr/bin/afslocker</filename> does not need to do anything, and could also be a dummy script that does nothing.
</para>
</sect2>

<sect2><title>Contact</title>
<para>
Questions, comments, or suggestions?  Contact
<ulink url="mailto:sipb-debian@mit.edu">sipb-debian@mit.edu</ulink>.
</para>
</sect2>

</sect1>
</article>
