Termius Mobile Setup Guide: Seamless SSH from Phone & iPad

Mobile-First SSH Access 📱
Professional terminal access from iOS/Android → Your development servers
Complete setup for ProDG mainframe + any SSH server

🎯 Overview

End Goal: Professional SSH terminal on your phone/tablet that rivals desktop experience

  • One-tap connections to all your servers
  • Persistent sessions that survive network changes
  • Synchronized setup across all mobile devices
  • Advanced features like port forwarding, SFTP, and agent forwarding

Perfect for: Checking deployments, emergency fixes, mobile development, remote debugging


📱 Initial Installation & Account Setup

Download Termius

Create Account (Required for Sync)

  1. Launch app → "Get Started"
  2. Create account with email/password or Google/Apple sign-in
  3. Verify email (check spam folder)
  4. Enable sync in settings for cross-device consistency

Why account matters: Without it, you lose all configurations when switching devices or reinstalling.


🔐 SSH Key Generation & Management

Generate Strong SSH Key on Mobile

iOS/iPadOS Steps:

  1. Main screen → Keychain tab (bottom)
  2. "+" button → "Generate Key"
  3. Configure key:
    Label: ProDG-Mobile-Key-2024
    Key Type: RSA
    Key Size: 4096 bits
    Passphrase: [Use strong passphrase]
    Save Passphrase: ✅ (for convenience)
    
  4. "Generate & Save"

Android Steps:

  1. Menu → Keychain
  2. "+" → "Generate Key"
  3. Same configuration as iOS above
  4. "Save"

Export Public Key for Server

  1. Keychain → Select your key → "Edit"
  2. Copy public key (the long text starting with ssh-rsa)
  3. Email/message yourself or use QR code feature

🖥 Server Configuration (ProDG Mainframe)

Add Your Mobile Key to Server

# On your ProDG mainframe (65.109.89.215)
# SSH in from desktop first, then:

# Create SSH directory if it doesn't exist  
mkdir -p ~/.ssh
chmod 700 ~/.ssh

# Add your mobile public key
nano ~/.ssh/authorized_keys
# Paste the public key from Termius app (one line)
# Save: Ctrl+X, Y, Enter

# Set correct permissions
chmod 600 ~/.ssh/authorized_keys

# Test: you should now be able to connect from Termius mobile

Optimize SSH Server for Mobile

# Edit SSH server config for better mobile experience
sudo nano /etc/ssh/sshd_config

# Add/modify these lines:
ClientAliveInterval 60          # Send keepalive every 60s
ClientAliveCountMax 3           # Allow 3 missed keepalives  
TCPKeepAlive yes               # Enable TCP-level keepalives
Compression yes                # Compress data (saves mobile bandwidth)
UseDNS no                     # Skip reverse DNS (faster connections)

# Restart SSH service
sudo systemctl reload sshd

📲 Host Configuration in Termius

Add ProDG Mainframe Host

iOS/iPadOS:

  1. Hosts tab → "+" → "New Host"
  2. Configure:
    Alias: ProDG Mainframe  
    Hostname: 65.109.89.215     # public IP — reachable from anywhere
    Username: root
    Port: 22
    
  3. Credentials section:
    • "+ SSH ID, Key, Certificate, FIDO2"
    • Select: Your generated key (ProDG-Mobile-Key-2024)
  4. Save

Android:

  1. "+" → "New Host"
  2. Same configuration as iOS
  3. Authentication: Select SSH key you generated

Prefer the tailnet when the device is already on the mesh. If Tailscale is running on the iPad/MacBook, use 100.64.0.1 as the hostname instead of the public IP — same shell, but nothing traverses the public internet. Add it as a second host so you keep a fallback if the mesh is down.

Advanced Host Settings ⚡

Enable for better mobile experience:

  1. Edit your host → "Advanced"
  2. Configure:
    SSH Agent Forwarding: ✅ (if you use multiple keys)
    Keep Alive: ✅ 
    Compression: ✅
    Terminal Type: xterm-256color
    

🚀 Advanced Mobile Features

Port Forwarding Setup

Access web services on your server from mobile browser:

  1. Edit host → "Port Forwarding" → "+"

  2. Configure common forwards:

    # Hermes Web Dashboard
    Local: 3000 → Remote: 3000
    
    # Hermes MCP Server  
    Local: 8000 → Remote: 8000
    
    # Database (if needed)
    Local: 5432 → Remote: 5432
    
    # Caddy/Nginx (web server)
    Local: 8080 → Remote: 80
    
  3. Connect to host → Open mobile browser → localhost:3000 = server's port 3000

SFTP File Transfer

Upload/download files between mobile and server:

  1. Connect to host via SSH first
  2. Swipe right or use menu → "SFTP"
  3. Navigate mobile files (left) and server files (right)
  4. Long press file → "Upload"/"Download"

Use cases:

  • Download log files for mobile analysis
  • Upload small config changes made on mobile
  • Transfer screenshots from mobile to server

Multiple Sessions Management

Run multiple terminals simultaneously:

  1. Connect to host
  2. Swipe right → "Split View" or "New Tab"
  3. Common multi-session setup:
    Tab 1: htop                    # System monitoring
    Tab 2: tail -f /var/log/syslog # Live log monitoring  
    Tab 3: hermes --tui           # Hermes terminal UI
    Tab 4: cd /opt/prodg && ls    # Project navigation
    

Split screen on iPad: Drag tab to edge → side-by-side terminals


🎨 Mobile-Optimized Terminal Setup

Server-Side Terminal Improvements

# Install mobile-friendly tools on your server
sudo apt update
sudo apt install -y htop micro ranger ncdu bat exa

# Create mobile-optimized aliases
cat >> ~/.bashrc << 'EOF'

# Mobile-friendly aliases (shorter commands, clearer output)
alias ll='exa -la --icons'
alias lt='exa -T --icons' 
alias h='hermes'
alias hchat='hermes chat -q'
alias hstatus='hermes doctor'
alias status='htop'
alias logs='tail -f ~/.hermes/logs/gateway.log'
alias disk='ncdu /'
alias edit='micro'  # Better than nano on mobile

# Colored output
export CLICOLOR=1
export TERM=xterm-256color

# Shorter prompt for mobile screens
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
EOF

# Apply changes
source ~/.bashrc

Termius Mobile Settings

Optimize for your device:

iPhone Settings:

Appearance:
- Font: SF Mono, 12pt
- Cursor: Block (more visible)
- Theme: Dark or Pro Dark

Input:
- Haptic Feedback: ✅
- Auto-correction: ❌ 
- Smart Punctuation: ❌
- Hardware keyboard support: ✅

Gestures:
- Shake for Tab: ✅
- Swipe for navigation: ✅
- Three-finger swipe: Enabled

iPad Settings:

Appearance:  
- Font: SF Mono, 14pt (bigger for tablet)
- Split view support: ✅
- External keyboard: ✅

Advanced:
- Mouse support: ✅ (if using with trackpad)
- Shortcuts displayed: ✅

Android Settings:

Appearance:
- Font: Roboto Mono, 14pt  
- Theme: Material Dark

Input:
- Hardware keyboard: ✅
- Gesture typing: ❌ (conflicts with terminal)
- Autocorrect: ❌

Advanced:
- Developer mode: ✅ (for better terminal emulation)

🛠 Custom Commands & Snippets

Save Frequent Commands

Create one-tap shortcuts for common tasks:

  1. Menu → "Snippets" → "+"
  2. Add useful snippets:
# System Status Check
Name: Status Check
Command: echo "=== System Status ===" && uptime && df -h / && docker ps --format "table {{.Names}}\t{{.Status}}"

# Hermes Quick Status  
Name: Hermes Status
Command: hermes doctor && hermes gateway status

# View Recent Logs
Name: Recent Logs
Command: tail -50 ~/.hermes/logs/gateway.log | grep -E "(ERROR|WARN|INFO)"

# Backup Critical Files
Name: Quick Backup
Command: tar -czf ~/backup-$(date +%Y%m%d-%H%M).tar.gz ~/.hermes/config.yaml /opt/prodg/compose/.env

# Network Test
Name: Network Test  
Command: ping -c 3 8.8.8.8 && curl -I https://api.nousresearch.com

# Docker Status
Name: Docker Status
Command: docker system df && docker ps -a --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
  1. Usage: In terminal → Long press → "Snippets" → Select snippet

Emergency Commands

Critical commands for mobile emergency response:

# Restart All Services  
Name: Emergency Restart
Command: sudo systemctl restart docker && cd /opt/prodg/compose && docker compose restart
# NOTE: `hermes gateway restart` must run from a shell OUTSIDE the gateway —
# the agent cannot restart itself (SIGTERM guard). Run it separately.

# Kill Resource Hogs
Name: Kill Heavy Processes  
Command: sudo pkill -f "node|python.*100" && docker system prune -f

# Quick Security Check
Name: Security Check
Command: sudo fail2ban-client status && sudo ufw status && who

# Disk Cleanup
Name: Clean Disk
Command: sudo apt autoremove -y && docker system prune -f && sudo journalctl --vacuum-size=100M

🔄 Multi-Device Sync & Backup

Sync Across Devices

Automatic sync (Premium feature):

  1. Settings → "Cloud Sync" → "Enable"
  2. Choose what to sync:
    ✅ Hosts
    ✅ SSH Keys  
    ✅ Snippets
    ✅ Settings
    ✅ Themes
    

Manual export/import (Free):

  1. Settings → "Export Data" → "All Data"
  2. Email file to yourself
  3. On other device: Settings → "Import Data" → Select file

Backup Strategy

Create regular backups:

# On your server - backup SSH access configs
mkdir -p ~/mobile-ssh-backup
cp ~/.ssh/authorized_keys ~/mobile-ssh-backup/
cp /etc/ssh/sshd_config ~/mobile-ssh-backup/
tar -czf ~/mobile-ssh-backup-$(date +%Y%m%d).tar.gz ~/mobile-ssh-backup/

Store Termius export file safely:

  • Cloud storage (Google Drive, iCloud, Dropbox)
  • Password manager (1Password, Bitwarden)
  • Email yourself the export file

📊 Troubleshooting Common Issues

Connection Problems

"Connection Refused":

# On server - check SSH service
sudo systemctl status ssh
sudo systemctl restart ssh

# Check if port 22 is open
sudo netstat -tlnp | grep :22
sudo ufw allow 22/tcp

"Authentication Failed":

# Check SSH key permissions on server
ls -la ~/.ssh/
chmod 600 ~/.ssh/authorized_keys
chmod 700 ~/.ssh/

# Verify key format (should be one line)
cat ~/.ssh/authorized_keys | wc -l  # Should output number of keys

"Connection Timeout on Mobile":

  1. Check mobile network: Try different WiFi/cellular
  2. Verify server IP: ping 65.109.89.215 from mobile browser
  3. Check server firewall: Temporarily disable to test
  4. Try different port: Change SSH to port 2222 temporarily

Performance Issues

Slow Terminal Response:

  1. Termius settings → Reduce font size (less rendering)
  2. Disable animations in accessibility settings
  3. Use simpler shell prompt (shorter PS1)
  4. Reduce command history size

High Bandwidth Usage:

# On server - enable compression
sudo nano /etc/ssh/sshd_config
# Add: Compression yes
sudo systemctl reload sshd

# In Termius - enable compression in host settings

App-Specific Issues

iOS/iPadOS:

  • App crashes: Force close → reopen → clear cache in settings
  • Keyboard issues: Settings → General → Keyboard → reset keyboard dictionary
  • Background disconnect: Settings → Background App Refresh → enable for Termius

Android:

  • Permission issues: Settings → Apps → Termius → Permissions → enable all
  • Battery optimization: Disable battery optimization for Termius
  • Network security: Disable VPN temporarily to test connections

⚡ Pro Tips & Advanced Usage

Productivity Hacks

Quick Navigation:

  • Double-tap empty space: Open virtual keyboard
  • Three-finger swipe: Switch between tabs
  • Long press toolbar: Quick access to functions
  • Shake device: Send Tab key (great for auto-completion)

Advanced SSH Features:

# SSH Agent Forwarding - use your mobile keys on remote servers
# Enable in Termius host settings, then on server:
ssh-add -l  # Should show your mobile key

# Jump Host Setup (connect through multiple servers)
# Host settings → Advanced → Jump Host
# Useful for: Mobile → VPS → Internal Server

Scripting for Mobile:

# Create mobile-optimized scripts on server
mkdir -p ~/mobile-scripts

# System health script optimized for mobile screen
cat > ~/mobile-scripts/health.sh << 'EOF'
#!/bin/bash
clear
echo "📊 $(hostname) Health - $(date '+%H:%M')"
echo "=================================="
echo "💾 Disk: $(df -h / | awk 'NR==2{print $5}') used"  
echo "🧠 RAM:  $(free -h | awk 'NR==2{print $3"/"$2}')"
echo "⚡ CPU:  $(uptime | awk -F'load average:' '{print $2}')"
echo "🐳 Docker: $(docker ps -q | wc -l) containers"
echo "🤖 Hermes: $(pgrep hermes > /dev/null && echo "✅" || echo "❌")"
echo "=================================="
EOF

chmod +x ~/mobile-scripts/health.sh
# Add to snippets: ~/mobile-scripts/health.sh

Integration with Development Workflow

Mobile → Server → AI Workflow:

# 1. Check deployment from mobile
~/mobile-scripts/health.sh

# 2. If issues, get AI help via Hermes
hermes chat -q "Help debug: $(docker ps | grep -v healthy)"

# 3. Apply fixes from mobile (each stack is its own compose project)
cd /opt/prodg/compose && docker compose restart failing-service

# 4. Verify fix
curl -f https://mainframe.prodg.studio/health

# 5. Document in Hermes for team
hermes chat -q "Log: Fixed failing-service issue on $(date). Root cause: [description]. Resolution: [steps taken]."

✅ Setup Validation Checklist

Basic Functionality

  • [ ] SSH connection works from mobile to ProDG mainframe
  • [ ] Key authentication successful (no password prompts)
  • [ ] Multiple tabs/sessions can be opened simultaneously
  • [ ] SFTP file transfer works both directions
  • [ ] Port forwarding enables web access from mobile browser

Advanced Features

  • [ ] SSH agent forwarding works for chained connections
  • [ ] Custom snippets execute correctly
  • [ ] Background sessions survive app switching
  • [ ] Cross-device sync keeps configurations consistent
  • [ ] Emergency commands are ready and tested

Mobile Optimization

  • [ ] Font size is readable but fits content
  • [ ] Virtual keyboard works smoothly with terminal
  • [ ] Gestures are enabled and learned
  • [ ] Network changes don't break connections
  • [ ] Battery usage is reasonable for your needs

Production Readiness

  • [ ] Backup procedures documented and tested
  • [ ] Alternative access methods configured
  • [ ] Emergency contacts have admin access if you're locked out
  • [ ] Security review completed (strong keys, secure config)
  • [ ] Team members can replicate mobile setup

🎯 Next Steps: Advanced Mobile DevOps

Mobile-First Monitoring Setup

# Set up mobile alerts via Hermes
hermes cronjob create \
  --schedule "*/10 * * * *" \
  --prompt "Check system health and alert if CPU >90% or disk >85%" \
  --deliver "sms:+your-number" \
  --name "mobile-health-alerts"

# Mobile deployment notifications  
hermes cronjob create \
  --schedule "0 */4 * * *" \
  --prompt "Check /opt/prodg git status and deployment health" \
  --deliver "telegram" \
  --name "deployment-status"

Mobile Emergency Response

# Create mobile emergency runbook
cat > ~/mobile-emergency.md << 'EOF'
# Mobile Emergency Response

## 🚨 Server Down
1. SSH via Termius
2. Run: `sudo systemctl status`  
3. Check: `docker ps`
4. Restart: `sudo reboot` (last resort)

## 🔒 SSH Access Lost
1. Use Hermes via Telegram: "SSH to mainframe and check status"
2. Contact team member with backup access
3. Use server console access if available

## 💾 Disk Full
1. Run snippet: "Clean Disk"  
2. Check: `docker system df`
3. Emergency: `sudo rm -rf /tmp/*`

## 📡 Network Issues  
1. Check: `ping 8.8.8.8`
2. Restart networking: `sudo systemctl restart networking`
3. Check firewall: `sudo ufw status`
EOF

Setup Complete! 📱 You now have professional SSH access to your development servers from any mobile device, with advanced features like port forwarding, file transfer, and emergency response capabilities.

Pro Tip: Practice the emergency procedures when everything is working, so you're ready when something breaks at 2 AM and you only have your phone! ~