メインコンテンツにスキップ

frp+ssh+dockerは制限付きネットワーク(client)

手順を設定

設定項目が必要です

  • serverAddr
  • サーバー Port
  • トークン/トークン
  • proxies.name
  • proxies.customDomains
{
    // 必须参数
    "serverAddr": "55.44.33.33",
    // 必须参数
    "serverPort": 18000,
    "auth": {
        "method": "token",
        // 必须参数
        "token": "frps-ssh"
    },
    "loginFailExit": false,
    "transport": {
        "heartbeatInterval": 25,
        "heartbeatTimeout": 120,
        "poolCount": 10,
        "tcpMux": true
    },
    "proxies": [
        {
            // 必须参数
            "name": "frpc-ssh-fa",
            "type": "tcpmux",
            "multiplexer": "httpconnect",
            // 必须参数
            "customDomains": ["fa.intranet.company"],
            "localIP": "127.0.0.1",
            "localPort": 22
        }
    ]
}

次の最適化

# 服务端配置
# sudo nano /etc/ssh/sshd_config
# 每60秒向客户端发送心跳
ClientAliveInterval 60
# 允许5次心跳失败(总共300秒)
ClientAliveCountMax 5
# 启用TCP保活
TCPKeepAlive yes