Erik The Red

The robot had been flaking out with its RedHat 6.0 (!) install, so Debian stable was installed on it. The old partitions are still mounted under /old-usr, etc.

How user accounts work

The /etc/password and /etc/group files on leif are what get used on both machines. Any user or group with a high enough number (currently >= 1000) gets an account on both machines. The home directories are mounted via NFS on thorvald.

Adding a user account

Let's suppose bob wants an account on the robot.

  • Log into leif
  • sudo adduser --firstuid 6000 bob
  • sudo gpasswd -a admin bob (only do this if you want to trust bob with sudo access)
  • cd /var/yp; sudo make

That's all there is to it!

Rebooting the robot

The robot has problems when rebooting, because some services come up before the services they depend on are up. And thorvald boots faster than leif but depends on leif. So, after a reboot, if thorvald is misbehaving, log in as root on leif, kill the ypbind process, and run /etc/init.d/nis restart. Also run /etc/init.d/nfs-user-server restart. Then log into thorvald as root, kill the ypbind process, and run /etc/init.d/nis restart, then mount -a.

Common config to leif and thorvald

Both have sudo installed, with people in the group admin having sudo access. Both also have xbase-clients installed, so that X11 forwarding over ssh works.

The network on the machines is set up so that they talk to each other over ethernet and to the rest of the world via their 802.11g cards. Their /etc/network/interfaces look like:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
auto ath0
iface ath0 inet dhcp
wireless_mode managed
wireless_essid StataCenter
wireless_rate 54M auto
wireless_enc off

The eth0 address for leif is 192.168.0.10, and for thorvald it is 192.168.0.11. Note that the eth0 stanzas do not have gateways, so that the machines don't try to route packets intended for the outside world via eth0.

The 802.11g wireless cards are Dlink DWL-G520 Atheros-based cards. Instructions for setting up the drivers and things are at http://www.mattfoster.clara.co.uk/madwifi-faq.htm

Moving to a different subnet

If the computers are moved to a different subnet, then they will both behave very badly, thorvald more so than leif. This is because NIS will be broken (although with the new static local routing, they may behave better). To fix it, remove the /var/yp/binding directory on each machine, and on leif, change /etc/ypserv.securenets to allow NIS bindings in the new subnet. If thorvald is timing out without giving you a chance to log in at the console, try ssh-ing in.

CVS

The CVS repository is in /var/lib/cvs. In order to get permissions to work so that new projects and files don't have to have permissions set manually each time, I left the directory /var/lib/cvs with the sticky directory bit set, and I changed its group owner to be users. What this does is make every subdirectory automatically owned by users (and CVS makes these directories group-writable). Then, everyone who needs CVS access should be added to users.

leif

leif hosts home directories and is the NIS domain master for the robot. leif is a dual CPU machine, so it has an SMP kernel. To set up leif from a standard Debian stable install:

  • 3c59x and bttv were added to /etc/modules. These are the modules for the ethernet and video cards, resp.
  • The packages ssh and nis were installed. The NIS domain is niserik.
  • The following lines were added to /etc/yp.conf:
ypserver leif.csail.mit.edu
domain niserik server leif.csail.mit.edu
  • The following changes to /etc/ypserv.securenets:
#0.0.0.0 0.0.0.0
255.255.0.0 128.30.0.0
255.255.255.0 192.168.0.0
The first line is commented out so that the world doesn't get to join the NIS domain. The second and third lines are added so that anyone on the CSAIL subnet and anyone in 192.168.0.* (in particular, thorvald) gets to.
  • /etc/default/nis was changed to say NISSERVER=master
  • /var/yp/Makefile was changed so that the only things exported are: passwd group rpc services
  • /usr/lib/yp/ypinit -m
  • /etc/init.d/nis restart
  • The packages nfs-common and nfs-user-server were installed.
  • The following lines were added to /etc/exports:
/home erik(rw) thorvald(rw)
/usr/local erik(rw) thorvald(rw)
  • /etc/init.d/nfs-user-server restart
  • mknod /dev/video0 c 81 0
  • chmod a+rw /dev/video0

At this point, leif is an NIS master and exports the home directories so that thorvald can get at them. leif also should have the camera functioning.

thorvald

thorvald has the multi-serial port card to let it talk to the robot. To set up thorvald from a standard Debian install:

  • tulip and rocket were added to /etc/modules. These are the modules for the ethernet and serial port card, resp.
  • The packages nis and ssh were installed. Again, the NIS domain is niserik.
  • The following lines were added to /etc/yp.conf:
ypserver leif.csail.mit.edu
domain niserik server leif.csail.mit.edu
  • mknod /dev/ttyR0 c 46 0 (this and the following lines make devices for the serial card)
  • mknod /dev/ttyR1 c 46 1
  • ...
  • mknod /dev/ttyR7 c 46 0
  • chmod go+w /dev/ttyR*
  • The line "+::::::" (without the quotes) was added to /etc/passwd and /etc/group.
  • /etc/init.d/nis restart