SSH Configuration
Enable SSH Query
The SSH query interface is disabled by default. You can enable it using any of these methods:SSH Configuration Options
| Parameter | Environment Variable | Default | Type | Description |
|---|---|---|---|---|
--query-ssh-enable | TSSERVER_QUERY_SSH_ENABLED | false | Boolean | Enables the SSH query interface |
--query-ssh-port | TSSERVER_QUERY_SSH_PORT | 10022 | Integer (1-65535) | Port for SSH query connections |
--query-ssh-ip | TSSERVER_QUERY_SSH_IP | [0.0.0.0, ::] | String | IP addresses to bind for SSH queries |
--query-ssh-rsa-key | TSSERVER_QUERY_SSH_RSA_KEY | ssh_host_rsa_key | String | Path to SSH RSA host key file |
SSH Host Key Setup
The SSH query interface requires an RSA host key for secure connections.Check for Existing Key
First, check if a host key already exists:If the file exists, you can skip key generation.
Generate RSA Host Key
If no key exists, generate one using ssh-keygen:This creates two files:
ssh_host_rsa_key- Private key (keep secure)ssh_host_rsa_key.pub- Public key
Binding to Specific IP Addresses
By default, SSH query binds to all available IPv4 and IPv6 addresses. You can restrict this to specific IPs:Complete Configuration Examples
Basic SSH Query
Simple SSH query configuration:tsserver.yaml
Production SSH Configuration
Secure SSH configuration for production with IP restrictions:tsserver.yaml
Custom SSH Port
Using a non-standard port for additional security:tsserver.yaml
Using a non-standard SSH port can reduce automated attack attempts, but security through obscurity should not be your only defense.
Connecting to SSH Query
Using SSH Client
Connect to your TeamSpeak server via SSH query:Basic Connection
First Connection
On your first connection, you’ll see a host key fingerprint warning:yes to accept and continue.
Example Session
Docker Configuration
When running TeamSpeak 6 in Docker, expose the SSH query port:Firewall Configuration
Ensure your firewall allows SSH query traffic:UFW (Ubuntu)
firewalld (CentOS/RHEL)
iptables
Testing Your Configuration
Verify Service is Listening
Check that the server is listening on the SSH query port:You should see port 10022 (or your configured port) listed.
Automation with SSH Query
SSH query is ideal for automation scripts:Single Command Execution
Execute a single query command:Script with Multiple Commands
Using SSH Keys for Authentication
While password authentication is standard, you can also configure SSH public key authentication for automated scripts. Consult your TeamSpeak 6 documentation for details on query user SSH key setup.Security Best Practices
- Use strong passwords: Set a strong admin password with
--query-admin-password - Restrict IP access: Use
--query-ip-allow-listto limit which IPs can connect - Enable logging: Use
--query-log-commandsto audit query activity - Secure the host key: Keep your SSH host private key (ssh_host_rsa_key) secure with proper permissions
- Use non-standard ports: Consider using a custom port to reduce automated attacks
- Enable brute force protection: Keep
--query-skip-brute-force-checkdisabled (default) - Monitor connections: Regularly review query logs for suspicious activity
- Limit exposure: Bind to specific IPs instead of all interfaces when possible
Troubleshooting
Connection Refused
If you get “Connection refused”:- Verify SSH query is enabled
- Check the server is listening:
netstat -tlnp | grep 10022 - Verify firewall rules allow the port
- Check server logs for errors
Host Key Verification Failed
If the host key has changed:Permission Denied
If authentication fails:- Verify you’re using the correct admin password
- Check that
--query-admin-passwordis set - Review query logs for authentication attempts
- Ensure your IP is not in the block list
Next Steps
HTTP/HTTPS Query
Configure the HTTP and HTTPS query interfaces
Authentication
Set up query admin credentials