Nicholas Dodds

CS servers quick reference

CS servers quick reference

Commands for administering Harvey Mudd CS servers: mail aliases, passwords and accounts, DHCP and DNS, quotas, package history, NVIDIA drivers and drive upgrades.

For CS staff. Internal procedures change; confirm destructive commands before running them. Selected commands were checked against documentation in September 2026, not rerun.

Email aliases

Clinic aliases are in /etc/postfix/aliases_clinic on Ark, under RCS: check the file out, edit it, check it in, then rebuild the alias database.

  1. Connect to Ark:

    ssh ndodds@ark
  2. Go to the Postfix folder and check the file out, which locks it:

    cd /etc/postfix/
    co -l aliases_clinic
  3. Edit it:

    vim aliases_clinic
  4. Check it in and rebuild the alias database:

    ci -u aliases_clinic
    newaliases

User passwords

Passwords are changed in Open Directory on Cortana. Replace USERNAME with the account to change; -u names the administrator making the change.

ssh cortana
passwd -i opendirectory -u ndodds USERNAME

Account lookups

Show a user's ID and groups, their password-file entry, or their details:

id ndodds
getent passwd ndodds
finger dodds

LDAP lookups

Show a user's LDAP entry, or only the fields you name (here, common name and email):

ldapsearch -LLLx uid=ndodds
ldapsearch -LLLx uid=ndodds cn mail

Restarting sssd

Hopper uses OpenRC; Lovelace and Granville use systemd.

ssh root@hopper
/etc/init.d/sssd restart
systemctl restart sssd

Static DHCP addresses

Static bindings live in the guest43 pool on neutron, the network server. Replace xxx with the address's last number, and xx:xx:xx:xx:xx:xx with the client's MAC address.

Find the binding

  1. Find the client's current address:

    ip addr
  2. Connect to neutron and look up the binding:

    ssh mudd@neutron.cs.hmc.edu
    show ip dhcp bind | incl 134.173.43.xxx

Remove a binding

Clearing a binding removes it from the active table only; the client may still try to renew the old address:

clear ip dhcp bind 134.173.43.xxx

To remove it completely, delete it from the pool's configuration so the server can't reassign it:

conf term
ip dhcp pool guest43
no addr 134.173.43.xxx

Add a static binding

  1. Enter configuration mode and open the pool:

    conf term
    ip dhcp pool guest43
  2. Bind the address to the client:

    addr 134.173.43.xxx client-id 01xx:xx:xx:xx:xx:xx

    Start the client ID with 01

    The client ID is 01, the hardware type for Ethernet, followed by the MAC address. Without the prefix, the binding won't match the client's request.

  3. Leave configuration mode with end, then save the configuration:

    write mem

DNS zone edits

The cs.hmc.edu zone is in /mnt/dns on Ark, under RCS. Freeze it, edit it, then check it before thawing.

  1. Connect to Ark:

    ssh ndodds@ark.cs.hmc.edu
  2. Freeze the zone and check the file out:

    cd /mnt/dns
    sudo rndc freeze cs.hmc.edu
    sudo co -l cs.hmc.edu
  3. Edit the zone:

    sudo vim cs.hmc.edu

    Increment the serial number

    Raise the serial number at the top of the file with every edit.

  4. Check the file in:

    sudo ci -u cs.hmc.edu
  5. Validate the zone, and thaw it only if that passes; see the BIND zone-checking reference:

    named-checkzone cs.hmc.edu /mnt/dns/cs.hmc.edu && sudo rndc thaw cs.hmc.edu

Disk quotas

Run these on the file server, replacing username with the account. View a user's quota:

sudo quota -vs -u username

Edit it:

sudo edquota username

Reset it to the default, copied from the quotatemplate account:

sudo edquota -p quotatemplate username

APT install history

List who installed what, from the current and rotated APT history logs, compressed or not:

for log in /var/log/apt/history.log /var/log/apt/history.log.*; do
  if [[ "$log" == *.gz ]]; then
    zcat "$log" | perl -00 -lne 'next unless m/\nRequested-By: (\w+) \(\d+\) /;
      my $user = $1;
      printf "%s: %s\n", $user, $1 if m/Commandline:\s+(.*)/' | grep install
  else
    cat "$log" | perl -00 -lne 'next unless m/\nRequested-By: (\w+) \(\d+\) /;
      my $user = $1;
      printf "%s: %s\n", $user, $1 if m/Commandline:\s+(.*)/' | grep install
  fi
done

NVIDIA driver module

List the processes using the GPUs, for example to diagnose “device busy” errors or before unloading the driver:

sudo lsof /dev/nvidia*

Unload the driver module, for troubleshooting or before a driver update. Stop every program using the GPU first:

modprobe -r nvidia

Create the device files in /dev if they're missing. This usually happens automatically at boot or after a driver install:

nvidia-modprobe

Upgrading to a larger NVMe drive

Clone the old drive onto a larger one from an Ubuntu live USB, then grow the partition and filesystem to fill it.

  1. Shut the system down. Move the old NVMe drive to an external USB adapter, and fit the new drive in the motherboard's M.2 slot.
  2. Boot from an Ubuntu USB installer and choose Try Ubuntu without installing. When the desktop loads, open Terminal (Ctrl+Alt+T).
  3. List the drives:

    lsblk -o NAME,MODEL,SERIAL,SIZE,TYPE,FSTYPE,MOUNTPOINTS

    Identify the source and destination by model, serial number and size; device names vary. Both must be unmounted. Typically:

    • Source, the old drive on USB: /dev/sda or /dev/sdb.
    • Destination, the new internal drive: /dev/nvme0n1.
  4. Check if and of

    if is the source and of the destination. Writing to the wrong drive is irreversible.

    Clone the drive, replacing /dev/sdX with the USB adapter's device, for example /dev/sda. bs=64K makes the copy much faster.

    sudo dd if=/dev/sdX of=/dev/nvme0n1 bs=64K conv=noerror,sync status=progress
  5. Move the backup partition table to the end of the new drive. After cloning it sits where the old drive ended. Open parted:

    sudo parted /dev/nvme0n1

    parted warns about the GPT table straight away. Type Fix:

    Warning: Not all of the space available to /dev/nvme0n1 appears to be used...
    Fix/Ignore? Fix
  6. Find the partition to grow, usually 2 or the largest:

    print
  7. Grow it to fill the drive, and quit:

    resizepart 2 100%
    quit
  8. ext4 on partition 2 only

    These commands assume an unmounted ext2, ext3 or ext4 filesystem directly on partition 2. Check that first. LVM, encryption and other filesystems need different steps; don't run these against them. See e2fsck's restrictions.

    Check the filesystem, then grow it to the partition's full size:

    sudo e2fsck -f /dev/nvme0n1p2
    sudo resize2fs /dev/nvme0n1p2
  9. Shut down, remove the USB installer and the external adapter, and boot from the new drive.