Nicholas Dodds

SSH Server Setup

Local CS131 Server Setup Guide

· Scope: CS131 course server workflow.

Warning

This guide assumes a test server creation. The sudo command is used throughout. Do not copy and paste these commands into your own machine, or any server of importance, unless you are sure you know what you are doing (or otherwise prompted).

1 Step 1: Set Up Server to Accept Username/Password

  1. Update and upgrade your system's packages:

    sudo apt update && sudo apt upgrade
  2. Press [Y] or [Enter] when prompted.

  3. Install and enable SSH for remote access:

    sudo apt install openssh-server && \
    sudo systemctl enable ssh && \
    sudo ufw allow ssh
  4. Install the micro text editor:

    sudo snap install micro --classic
  5. Edit SSH configuration to enable username and password authentication:

    sudo micro /etc/ssh/sshd_config
    • If the course requires password login, set PasswordAuthentication yes. Check included files in /etc/ssh/sshd_config.d/: Ubuntu processes these first, and an earlier value can override the main file. See Ubuntu’s OpenSSH configuration guide.
  6. Validate the configuration before restarting the Ubuntu SSH service. Keep the current connection open and test a second login:

    sudo sshd -t && sudo systemctl restart ssh.service

2 Step 2: Install zsh and oh-my-zsh

  1. Install zsh:

    sudo apt install zsh -y
  2. Install curl and git:

    sudo apt install git curl
  3. Install oh-my-zsh:

    sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  4. Follow the prompts, entering your password when required.

3 Step 3: Install Podman

  1. Install Podman:

    sudo apt install podman
  2. Test Podman with a Hello World image:

    podman run hello-world
  3. Create a shared image storage location:

    sudo mkdir /var/lib/shared-images && \
    sudo podman --root /var/lib/shared-images/ pull docker.io/harveymudd/cs131 && \
    sudo podman --root /var/lib/shared-images image ls

4 Step 4: Configure Podman

  1. Create and configure a system-wide storage.conf file:

    sudo micro /etc/containers/storage.conf
    • This recorded procedure omits the required storage settings. Obtain the reviewed additionalimagestores configuration for this server before proceeding; changing permissions alone does not configure shared storage.
  2. Update permissions to ensure all users can access the images:

    sudo chmod -R a+rX /var/lib/shared-images/

5 Step 5: Set Up User Templates

  1. Copy the .oh-my-zsh directory and .zshrc configuration file into /etc/skel to set defaults for new users:

    sudo cp -r ~/.oh-my-zsh /etc/skel/.oh-my-zsh && \
    sudo micro ~/.zshrc && \
    sudo cp ~/.zshrc /etc/skel/.zshrc
  2. Initialize configurations:

    source ~/.zshrc

6 Step 6: Create a New User

  1. Create a new user user001 and set a strong, unique password:

    sudo useradd -m -c "Test User 001" -s /bin/zsh user001 && \
    sudo passwd user001
  2. Ensure the user has access to shared images:

    sudo chmod -R a+rX /var/lib/shared-images/

7 Step 7: Login as a CS131 Student

  1. SSH into the server as user001:

    ssh user001@cs131.cs.hmc.edu
  2. Enter the password set earlier.

  3. Launch the CS131 environment using the alias from .zshrc. The alias body is missing from this record; obtain the course-approved shell configuration before this step:

    cs131env

8 Step 8: Configure User Memory Limits

  1. Become root and configure memory limits for users:

    su && \
    cd /etc/systemd/system && \
    mkdir -p /etc/systemd/system/user-.slice.d && \
    micro /etc/systemd/system/user-.slice.d/50-memory.conf
  2. This recorded procedure omits the [Slice] resource settings and the approved limit. Obtain those values from the course operator, then reload the system daemon:

    systemctl daemon-reload

9 Step 9: Test Memory Limits

  1. Use htop to monitor memory usage and test with resource-intensive commands.

Editorial and source review: September 4, 2026. Selected command and wording corrections were checked against documentation; this review did not rerun the server, GPU, VM, or cloud setup.