1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# SSH Channels Hub Configuration Example
# --- Channel definitions ---
# Channels reference hosts and define port forwarding
[[]]
= "db-tunnel"
= "example-server"
= "3306:3306" # Format: "local:dest" (local port 3306 -> dest port 3306)
# dest_host = "127.0.0.1" # 可选,默认为 "127.0.0.1"
[[]]
= "web-tunnel"
= "example-server2"
= "8080:80" # Format: "local:dest" (local port 8080 -> dest port 80)
= "127.0.0.1" # 可以显式指定,也可以省略(使用默认值)
# listen_host = "127.0.0.1" # 本地监听地址,默认 127.0.0.1;填 "0.0.0.0" 可接受任意网卡连接
# Remote forward (ssh -R style): bind port on server, bridge to local
# [[channels]]
# name = "expose-local-web"
# channel_type = "forwarded-tcpip"
# hostname = "example-server"
# ports = "8022:80" # Format: "remote:local" (server port 8022 -> local 127.0.0.1:80)
# dest_host = "127.0.0.1" # Local host to connect to (default 127.0.0.1)
# --- Reconnection settings ---
# (applies to all channels)
[]
# Maximum retry attempts (0 = unlimited)
= 0
# Initial delay in seconds before retry
= 1
# Maximum delay in seconds between retries
= 30
# Use exponential backoff (true) or fixed interval (false)
= true
# --- SSH Host definitions ---
# Hosts define how to connect to remote SSH servers
[[]]
= "example-server"
= "example.com"
= "user"
[]
= "key"
= "~/.ssh/id_rsa"
# Optional passphrase for the key
# passphrase = "your-key-passphrase"
# Another host example with password authentication
[[]]
= "example-server2"
= "example2.com"
= "user2"
[]
= "password"
= "your-password-here"