Skip to content

Commit

Permalink
update multiple-ssh-over-same-port (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier authored Feb 19, 2024
1 parent c9e4f2f commit 64c0068
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ public/
resources/
node_modules/
.hugo_build.lock
.DS_Store
4 changes: 2 additions & 2 deletions content/zh-cn/docs/Examples/multiple-ssh-over-same-port.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ description: >
使用 SSH ProxyCommand 访问内网机器 A,假设用户名为 test。使用以下命令:

```bash
ssh -o 'proxycommand socat - PROXY:x.x.x.x:machine-a.example.com:22,proxyport=5002' test@machine-a
ssh -o 'proxycommand socat - PROXY:x.x.x.x:%h:%p,proxyport=5002' test@machine-a.example.com
```

要访问内网机器 B,只需更改域名,假设用户名仍然为 test:

```bash
ssh -o 'proxycommand socat - PROXY:x.x.x.x:machine-b.example.com:22,proxyport=5002' test@machine-b
ssh -o 'proxycommand socat - PROXY:x.x.x.x:%h:%p,proxyport=5002' test@machine-b.example.com
```

通过按照以上步骤进行配置,您可以实现多个 SSH 服务复用同一端口,以便在具有公网 IP 的机器上进行访问。

0 comments on commit 64c0068

Please sign in to comment.