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:- Manually copy binaries to remote machine
- Manually start server
- Manually start terminal and capture client ID/passkey
- Manually configure firewall
- Hope everything works
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
Automated Bootstrap Script
PowerShell script for automated setup:Advanced Bootstrap Patterns
Bootstrap via Jump Host
When the target server is only accessible via a jump host:Bootstrap with Custom Server Config
Remote bootstrap script with configuration:Bootstrap Multiple Sessions
Set up multiple independent sessions: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):Firewall Configuration
Least-privilege firewall rules:Audit Logging
Enable server logging during bootstrap:Troubleshooting Bootstrap
Common Issues
Server won't start after bootstrap
Server won't start after bootstrap
Symptoms: Server process exits immediately after starting via SSH.Causes:
- Port 2022 already in use
- Insufficient permissions
- Antivirus blocking execution
Can't capture client ID/passkey from SSH output
Can't capture client ID/passkey from SSH output
Symptoms: Terminal output is garbled or not visible in SSH session.Solutions:
Firewall blocks connection after bootstrap
Firewall blocks connection after bootstrap
Symptoms: Server runs, credentials captured, but client connection times out.Solutions:
Server stops when SSH session closes
Server stops when SSH session closes
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:Run binaries manually
Open PowerShell as Administrator, start server and terminal as described in Basic Usage.
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| Feature | Undying Terminal Alone | Tmux + Undying Terminal |
|---|---|---|
| Network drops | Session survives | Session survives |
| Client disconnect | Session survives | Session survives |
| Terminal crashes | Session survives | Session survives |
| Shell exits | Session ends | Tmux preserves session |
| Multiple windows | One terminal | Multiple tmux windows |
| Scrollback | Client-side only | Server-side preserved |
Tmux Workflow Examples
Development Session:Tmux Commands Reference
Once inside a tmux session:| Command | Action |
|---|---|
Ctrl+b c | Create new window |
Ctrl+b n | Next window |
Ctrl+b p | Previous window |
Ctrl+b , | Rename window |
Ctrl+b d | Detach (session keeps running) |
Ctrl+b % | Split vertically |
Ctrl+b " | Split horizontally |
tmux ls | List sessions (in shell) |
tmux attach -t name | Attach to specific 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
- Configure Port Forwarding for secure tunnels
- Set up Jumphost access for complex networks
- Install as Windows Service for automatic startup
- Review Server Configuration options
- Learn about Built-in UI for multi-session management
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
| Directive | Description |
|---|---|
HostName | Real hostname/IP to connect to (resolves aliases) |
User | Default SSH username |
Port | Custom SSH port |
IdentityFile | Path to SSH private key |
ProxyJump | Jump through intermediate hosts |
LocalForward | Port forwarding (applied to Undying Terminal tunnels) |
ForwardAgent | Enable SSH agent forwarding |