Skip to main content

What is SSH Bootstrap?

SSH Bootstrap allows you to use an existing SSH connection to securely set up an Undying Terminal session. This solves the chicken-and-egg problem of remote deployment: Without SSH Bootstrap:
  1. Manually copy binaries to remote machine
  2. Manually start server
  3. Manually start terminal and capture client ID/passkey
  4. Manually configure firewall
  5. Hope everything works
With SSH Bootstrap:

How It Works

Basic Usage

Prerequisites

Local Machine

  • Undying Terminal client installed
  • SSH client (OpenSSH, PuTTY)
  • Network access to remote machine

Remote Machine

  • Undying Terminal binaries (server + terminal)
  • Windows 10 Build 17763+
  • Port 2022 accessible (can be firewalled initially)

Step-by-Step Bootstrap

1

Copy binaries to remote machine

2

SSH into remote machine

3

Run server in background

4

Start terminal and capture credentials

Save these values locally.
5

Configure firewall (if needed)

6

Connect from local machine

Automated Bootstrap Script

PowerShell script for automated setup:
Usage:

Advanced Bootstrap Patterns

Bootstrap via Jump Host

When the target server is only accessible via a jump host:
See also: Jumphost Guide for detailed tunneling setups.

Bootstrap with Custom Server Config

Remote bootstrap script with configuration:

Bootstrap Multiple Sessions

Set up multiple independent sessions:
Each session is isolated with its own passkey and buffer.

Security Considerations

SSH Key-Based Authentication

Always use SSH keys instead of passwords:

Passkey Security

Protecting the passkey during bootstrap: Bad (passkey in command history):
Good (generate on remote):
Best (use secrets manager):

Firewall Configuration

Least-privilege firewall rules:
Do NOT allow 0.0.0.0/0 (all IPs) unless absolutely necessary.

Audit Logging

Enable server logging during bootstrap:

Troubleshooting Bootstrap

Common Issues

Symptoms: Server process exits immediately after starting via SSH.Causes:
  • Port 2022 already in use
  • Insufficient permissions
  • Antivirus blocking execution
Solutions:
Symptoms: Terminal output is garbled or not visible in SSH session.Solutions:
Symptoms: Server runs, credentials captured, but client connection times out.Solutions:
Symptoms: Server and terminal die when you exit SSH.Cause: Processes inherit SSH session and get killed with it.Solutions:

Debugging Bootstrap Process

Verbose bootstrap script:

Best Practices

DO

  • Use SSH keys, not passwords
  • Generate passkeys on remote machine
  • Save credentials in password manager
  • Install server as Windows service
  • Configure firewall during bootstrap
  • Test connection before closing SSH

DON'T

  • Put passkeys in version control
  • Allow 0.0.0.0/0 firewall rules
  • Leave server running as SSH child process
  • Forget to save client ID/passkey
  • Skip testing the connection
  • Use same passkey across environments

Alternative Bootstrap Methods

Bootstrap via WinRM

If SSH is not available but WinRM is:

Bootstrap via RDP

Manual bootstrap over Remote Desktop:
1

RDP to remote machine

2

Run binaries manually

Open PowerShell as Administrator, start server and terminal as described in Basic Usage.
3

Save credentials locally

Copy client ID and passkey to your local machine.
4

Disconnect RDP

Sessions will persist after RDP disconnects.

Bootstrap via Configuration Management

Ansible playbook:

Tmux Integration (v1.1.0+)

Automatically wrap remote sessions in tmux for enhanced persistence:

Basic Tmux Usage

Why Use Tmux?

Tmux + Undying Terminal = Maximum Persistence

Tmux Workflow Examples

Development Session:
Persistent Build Process:
Multiple Projects:

Tmux Commands Reference

Once inside a tmux session:
Tmux must be installed on the remote server. Install with your package manager:
  • Ubuntu/Debian: apt install tmux
  • CentOS/RHEL: yum install tmux
  • macOS: brew install tmux

Next Steps

SSH Config File Support

Undying Terminal automatically reads your SSH config file (~/.ssh/config on Windows: %USERPROFILE%\.ssh\config) when using SSH bootstrap mode.

Supported Directives

Example SSH Config

Using SSH Config with Undying Terminal

Config Options

--ssh-config <PATH>

Specify a custom SSH config file path instead of the default.

--no-ssh-config

Disable SSH config file parsing entirely.

SSH Agent Forwarding

-A, --ssh-agent

Enable SSH agent forwarding (passes your local SSH keys to the remote session).

--no-ssh-agent

Explicitly disable SSH agent forwarding (overrides config file setting).