Skip to content

Servers and Global Config

Knot configuration contains servers, proxies, managed keys, and global settings. Sensitive values are stored with the ENC: prefix and encrypted through platform facilities or a machine-bound Linux fallback.

Server Commands

CommandDescription
knot add [alias]Add or overwrite a server configuration.
knot edit [alias]Edit an existing server configuration.
knot list [pattern]List servers. Alias: knot ls.
knot remove [alias]Remove a server. Aliases: knot rm, knot delete.

Common server fields:

FieldSource FlagDescription
Alias[alias] or --aliasServer alias used by most commands.
Host--hostHost name or IP address.
Port--portSSH port, default 22.
User--userSSH username.
Auth--auth-method, --password, --keyPassword, managed private key, or agent authentication.
Jump hosts--jump-hostComma-separated jump host alias chain.
Proxy--proxyManaged proxy alias.
Tags--tagsComma-separated tags for filtering and organization.

Global Config

sh
knot config [command]
CommandDescription
knot config initInitialize config or reset global settings to defaults. Existing servers, proxies, and keys are preserved.
knot config listList global settings. Alias: knot config ls.
knot config get [path]Print the full sanitized config or one sanitized path.
knot config set [key] [value]Set a global setting.

In knot config get, paths without dots are resolved under settings first:

sh
knot config get
knot config get log_level
knot config get servers.web-prod

Settable Keys

KeyValue TypeDescription
forward_agentboolWhether to forward the SSH agent.
clear_screen_on_connectboolWhether to clear the screen after connecting.
idle_timeoutGo durationIdle timeout for daemon-held connections.
keepalive_intervalGo durationSSH keepalive interval.
log_leveldebug, info, warn, errorLog level.

Examples:

sh
knot config set forward_agent true
knot config set idle_timeout 30m
knot config set log_level error

Config changes apply to new connections.

Import and Export

sh
knot export [path]
knot import [path]

knot export writes a password-encrypted archive. The default output path is config.toml.enc.

knot import reads a password-encrypted archive and lets you choose a merge strategy:

sh
knot export backup.enc
knot import backup.enc