← Back to Reference | ← Back to Documentation
You can enable debug output from the console by passing the DEBUG environment variable to your start script:
# Debug WebSSH2 specific events (recommended)
DEBUG=webssh*,-webssh2:ssh2 npm run start
# Debug everything WebSSH2
DEBUG=webssh* npm run start
# Debug Socket.IO events
DEBUG=engine,socket npm run start
# Debug Express events
DEBUG=express:* npm run start
# Debug everything (very verbose)
DEBUG=* npm run startNote: The webssh2:ssh2 namespace is very chatty and shows all SSH protocol information. The -webssh2:ssh2 excludes that namespace.
| Namespace | Description |
|---|---|
webssh2:* |
All WebSSH2 events |
webssh2:server |
Server initialization and configuration |
webssh2:socket |
WebSocket connection events |
webssh2:ssh |
SSH connection events (excluding protocol) |
webssh2:ssh2 |
Detailed SSH2 protocol information |
webssh2:auth |
Authentication events |
engine |
Socket.IO engine events |
socket |
Socket.IO socket events |
express:* |
Express framework events |
Causes:
- WebSSH2 server not running
- Incorrect port configuration
- Firewall blocking connection
Solutions:
- Verify server is running:
ps aux | grep node - Check port configuration:
netstat -an | grep 2222 - Test local connection:
curl http://localhost:2222/ssh - Check firewall rules
Causes:
- Invalid SSH credentials
- SSH server not running on target
- Network connectivity issues
Solutions:
- Test SSH directly:
ssh user@host - Verify SSH service:
systemctl status sshd - Check SSH logs:
tail -f /var/log/auth.log - Verify network path:
ping target-host
Causes:
- Target device only supports legacy algorithms (common with Cisco IOS, older network equipment)
- WebSSH2 algorithms configuration not including required algorithms
Solutions:
-
Enable SSH2 protocol debug to see negotiation details:
DEBUG=webssh2:ssh2 npm run start
-
Check the debug output for algorithm negotiation:
- Look for
Outgoing: Sending KEXINITto see what WebSSH2 offers - Look for
Inbound: Received KEXINITto see what the server offers - Compare the lists to find mismatches
- Look for
-
Configure required algorithms in
config.json:{ "ssh": { "algorithms": { "kex": [ "ecdh-sha2-nistp256", "diffie-hellman-group14-sha1" ], "serverHostKey": [ "ssh-ed25519", "ssh-rsa" ], "cipher": [ "aes256-ctr", "aes128-ctr" ], "hmac": [ "hmac-sha2-256", "hmac-sha1" ] } } } -
For legacy devices (Cisco IOS, older equipment), ensure these algorithms are included:
- KEX:
diffie-hellman-group14-sha1 - Host Key:
ssh-rsa - Cipher:
aes256-ctroraes128-ctr - MAC:
hmac-sha2-256orhmac-sha1
- KEX:
See Supported Algorithms for the full list of available algorithms.
Causes:
- Invalid credentials
- Session expired
- SSO misconfiguration
Solutions:
- Clear credentials: Navigate to
/ssh/clear-credentials - Force re-authentication: Navigate to
/ssh/reauth - Check SSO headers in debug mode
- Verify authentication configuration
Causes:
- Wrong key format
- Missing passphrase
- Key not in authorized_keys
Solutions:
- Ensure key is in PEM format
- Convert key properly for config.json
- Check server's
~/.ssh/authorized_keys - Verify file permissions:
chmod 600 ~/.ssh/authorized_keys
See Private Keys Documentation for detailed setup.
Causes:
- Wrong terminal type
- Character encoding mismatch
- Missing terminfo
Solutions:
- Try different terminal types:
?sshterm=xterm - Check locale:
locale - Install terminfo:
infocmp xterm-256color - Set UTF-8:
export LANG=en_US.UTF-8
Causes:
- Resize events not propagating
- PTY size mismatch
Solutions:
- Manually resize: Press
Ctrl+Lto refresh - Check window size:
echo $COLUMNS $LINES - Reset terminal:
resetortput reset
Causes:
- SSH server not configured to accept variables
- Variable format incorrect
- Allowlist blocking variables
Solutions:
- Check
AcceptEnvin/etc/ssh/sshd_config - Verify variable format:
^[A-Z][A-Z0-9_]*$ - Check allowlist configuration
- Restart SSH service after config changes
See Environment Forwarding for detailed setup.
Causes:
- Network latency
- Large scrollback buffer
- CPU throttling
Solutions:
- Reduce scrollback: Configure in client settings
- Use WebSocket transport only
- Enable GPU acceleration in browser
- Check server resources:
toporhtop
Causes:
- Memory leaks
- Too many concurrent sessions
- Large scrollback buffers
Solutions:
- Limit concurrent sessions
- Reduce scrollback buffer size
- Monitor memory:
node --inspect - Restart service periodically
Symptoms:
- Error:
DNS resolution failed for 'myhost' getaddrinfo ENOTFOUND hostnamein logs- IP addresses work but hostnames don't
Causes:
- Docker's internal DNS resolver (127.0.0.11) can't resolve external hostnames
Solutions:
-
Configure DNS servers (recommended):
docker run -d --dns 8.8.8.8 --dns 8.8.4.4 -p 2222:2222 ghcr.io/billchurch/webssh2:latest
-
Mount host's resolv.conf:
docker run -d -v /etc/resolv.conf:/etc/resolv.conf:ro -p 2222:2222 ghcr.io/billchurch/webssh2:latest
-
Use host network (not recommended):
docker run -d --network host -e WEBSSH2_LISTEN_PORT=2222 ghcr.io/billchurch/webssh2:latest
See Docker DNS Resolution for detailed configuration examples.
Causes:
- Network isolation
- Firewall rules
Solutions:
- Use host network:
--network host - Check container networking:
docker network ls - Verify connectivity:
docker exec <container> ping <target>
Causes:
- Wrong mount path
- Environment variables overriding
Solutions:
- Mount to correct path:
/srv/webssh2/config.json - Check environment variables:
docker exec <container> env - Verify file permissions in container
Always use HTTPS in production:
-
Generate certificates:
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes
-
Configure WebSSH2:
{ "ssl": { "key": "./key.pem", "cert": "./cert.pem" } }
-
Configure secure cookies:
{ "session": { "secret": "change-this-secret", "cookie": { "secure": true, "httpOnly": true } } } -
Set session timeout:
{ "session": { "resave": false, "saveUninitialized": false, "rolling": true, "cookie": { "maxAge": 3600000 } } }
Restrict origins in production:
{
"http": {
"origins": ["https://yourdomain.com"]
}
}Or via environment:
WEBSSH2_HTTP_ORIGINS="https://yourdomain.com"Causes:
- Browser blocking WebSocket
- Proxy interference
- CORS issues
Solutions:
- Check browser console for errors
- Verify CORS configuration
- Test without proxy
- Try different transport: Add polling fallback
Causes:
- Browser security restrictions
- Clipboard API permissions not granted
- Non-secure context (HTTP instead of HTTPS)
- Browser compatibility issues
Solutions:
WebSSH2 supports automatic copy on text selection (similar to PuTTY/tmux):
- Open Terminal Settings from the menu
- Enable "Auto-copy on selection"
- Select text with mouse - it's automatically copied
- Copy:
Ctrl+Shift+C(Windows/Linux) or⌘+Shift+C(macOS) - Paste:
Ctrl+Shift+V(Windows/Linux) or⌘+Shift+V(macOS)
- Open Terminal Settings
- Enable "Middle-click paste"
- Use middle mouse button to paste
- Check for clipboard permission prompts
- Ensure site is accessed via HTTPS or localhost
- Grant clipboard access when prompted
- Use right-click context menu
- Browser's Edit menu (if available)
- Terminal Settings to toggle clipboard features
Minimum versions for full clipboard support:
- Chrome/Edge 90+
- Firefox 88+
- Safari 14+
Note: All clipboard features can be configured in Terminal Settings or via localStorage under webssh2.settings.global
- Check existing issues: GitHub Issues
- Enable debug mode and collect logs
- Test with latest version
- Try with minimal configuration
Include the following:
- WebSSH2 version
- Node.js version
- Browser and version
- Debug output
- Configuration (sanitized)
- Steps to reproduce
- GitHub Discussions
- Stack Overflow tag:
webssh2 - Email support for enterprise users