Rescue SSH (Port 2222)

The rescue SSH daemon provides guaranteed emergency access to MEGATRON even under extreme system load, OOM conditions, or process storms.

Configuration

PropertyValue
Port2222
Config File/etc/ssh/sshd_config_rescue
Servicesshd-rescue.service (systemd)
Nice-20 (highest CPU priority)
OOM Score-1000 (OOM kill protected)
I/O SchedulingRealtime

When to Use

Use rescue SSH when:

  • Normal SSH (port 22) is unresponsive
  • System is under extreme CPU load
  • OOM killer is active
  • K3s pod storms are consuming resources
  • You need guaranteed access for emergency maintenance

Connecting

# From local machine
ssh -p 2222 lucas@megatron

# Using SSH config alias
ssh megatron-rescue

# From Mac Studio via Tailscale
ssh -p 2222 [email protected]

Service Management

# Check rescue SSH status
sudo systemctl status sshd-rescue

# Restart rescue SSH
sudo systemctl restart sshd-rescue

# View rescue SSH config
cat /etc/ssh/sshd_config_rescue

How It Works

The rescue SSH daemon runs as a separate sshd process with elevated scheduling priority:

  1. Nice -20 ensures it gets CPU time before any normal process
  2. OOMScoreAdjust=-1000 prevents the OOM killer from targeting it
  3. Realtime I/O scheduling ensures disk access even under I/O saturation
  4. Separate port (2222) avoids contention with the primary sshd on port 22