Skip to main content

Configuration File

The server reads configuration from:
Typical path: C:\ProgramData\UndyingTerminal\ut.cfg

Configuration Format

INI-style format with key=value pairs:

Configuration Options

Network Settings

port

Type: Integer
Default: 2022
Description: TCP port for server to listen on
Choose a non-standard port (>1024) to avoid conflicts and reduce automated scans.
Examples:

bind_ip

Type: IP Address
Default: 0.0.0.0
Description: IP address to bind server listener
Security Considerations:
  • Use 127.0.0.1 for local development
  • Use 0.0.0.0 for remote access (combine with firewall rules)
  • Use specific IP for multi-NIC servers

Logging

verbose

Type: Boolean (true / false)
Default: false
Description: Enable verbose logging
When true, server logs:
  • Client connections/disconnections
  • Packet types sent/received
  • Named pipe events
  • Tunnel creation/destruction
Output: Written to stdout/stderr
Verbose logging helps diagnose connection issues but increases log volume. Enable temporarily for debugging.

Security

shared_key_hex

Type: 64-character hex string (32 bytes)
Default: None (encryption disabled)
Description: Shared secret for XSalsa20 encryption
Encryption Details:
  • Algorithm: XSalsa20 (via libsodium)
  • Key size: 32 bytes (256-bit)
  • Nonce: 24 bytes (auto-incremented per packet)
  • Applied to all client ↔ server communication
Generate a Key:
  • Enable encryption for internet-facing servers
  • Encryption provides confidentiality only (no authentication/MAC)
  • Passkey is still sent in plaintext during initial handshake
  • Consider using VPN for highly sensitive environments

Example Configurations

Development (Local Only)

Production (Internet-Facing)

Multi-Server (Development)

When running multiple servers on one machine:
Then use environment variables:

Environment Variables

Override configuration at runtime:

UT_PIPE_NAME

Type: String (Windows named pipe path)
Default: \\\\.\\pipe\\undying-terminal
Description: Override named pipe path
Use Cases:
  • Running multiple servers on one machine
  • Avoiding pipe name conflicts
  • Development/testing isolation
Terminals must use the same UT_PIPE_NAME to connect to the correct server.

UT_DEBUG_HANDSHAKE

Type: Boolean (1 = enabled)
Default: Not set (disabled)
Description: Enable packet-level debug output
Output: Prints every packet type sent/received Example:

Command-Line Flags

Override config file settings:

--port <PORT>

--add-firewall

Automatically add Windows Firewall rule:
Creates rule:
  • Name: “Undying Terminal Server”
  • Direction: Inbound
  • Protocol: TCP
  • Port: Current port (from config or —port)
  • Action: Allow

--service

Run as Windows service:
When running as service:
  • Uses SYSTEM account
  • Starts automatically on boot
  • Logs to Windows Event Log
  • Handles graceful shutdown

Configuration Precedence

Settings are applied in this order (later overrides earlier):
  1. Defaults (hardcoded in binary)
  2. Config file (%PROGRAMDATA%\UndyingTerminal\ut.cfg)
  3. Environment variables (UT_PIPE_NAME, etc.)
  4. Command-line flags (--port, etc.)
Example:

Firewall Configuration

Windows Defender Firewall

This creates an inbound rule automatically.

Third-Party Firewalls

Configure your firewall to allow:
  • Inbound TCP on configured port (default 2022)
  • Application: undying-terminal-server.exe

Network Configuration

Port Forwarding (Router)

To access the server from external networks:
1

Find Internal IP

Example: 192.168.1.100
2

Configure Router

In your router’s admin panel:
  • External Port: 2022
  • Internal IP: 192.168.1.100
  • Internal Port: 2022
  • Protocol: TCP
3

Test External Access

Security: When exposing to the internet, always enable encryption via shared_key_hex.

Performance Tuning

High-Concurrency Environments

For >100 concurrent sessions:
OS Tuning (Windows):

Low-Bandwidth Networks

Client-Side: Reduce keepalive frequency (requires recompile)

Monitoring and Logs

Check Server Status

View Logs

When verbose=true:

Metrics to Monitor

Backup and Recovery

Backup Configuration

Restore Configuration

Troubleshooting Configuration

Error: Server uses default settingsSolution: Create config directory
Error: Server fails to start or uses defaultCheck:
  • Valid port number (1-65535, typically >1024)
  • Valid IP address for bind_ip
  • 64-character hex string for shared_key_hex
  • true/false for boolean values
Error: Client can’t connect (invalid handshake)Cause: Client and server have different encryption keysSolution: Ensure both use same shared_key_hex value
Error: bind: address already in useCheck what’s using the port:
Solutions:
  • Change port in config
  • Stop conflicting service
  • Use --port flag to override

Security Best Practices

Encryption

  • Enable shared_key_hex for production
  • Generate strong random keys (32 bytes)
  • Store keys securely
  • Rotate keys periodically

Network Isolation

  • Use bind_ip=127.0.0.1 for local-only
  • Use firewall rules to restrict access
  • Use VPN for sensitive environments
  • Avoid exposing to public internet

Access Control

  • Use strong random passkeys
  • Limit who knows passkeys
  • Monitor active sessions
  • Audit connections regularly

Operational Security

  • Run as Windows service (not user account)
  • Disable verbose logging in production
  • Monitor server logs
  • Keep software updated

Next Steps

Client Options

Configure client behavior

Environment Variables

Runtime configuration options

Windows Service Guide

Run server as a service

Troubleshooting

Solve configuration issues