补充 SSH 隧道.

Signed-off-by: lion.chan <cy187lion@sina.com>
This commit is contained in:
lion.chan 2022-08-31 08:49:59 +08:00
parent 9b36937a5d
commit 518505b398
1 changed files with 16 additions and 0 deletions

View File

@ -230,3 +230,19 @@ UserKnownHostsFile /dev/null
```
*关闭授权验证将增加 SSH 的安全隐患。*
## SSH 隧道
可以通过 SSH 隧道创建基于 SSH 加密传输的其他服务。比如通过 SSH 隧道创建远程桌面 VNC示例如下
```bash
# Server 端开启 SSH 服务后再开启 VNC 服务,默认使用 5901 端口
vncserver :1
# Client 端通过 SSH 隧道将 Server 的 5901 端口映射到本地的 5901 端口
ssh -g -L 5901:localhost:5901 [-p <server ssh port>] <user>@<remote addr>
# 输入密码后登录服务器
# Client 通过 VNC 客户端连接 localhost:5901 即可访问 Server 的 VNC 服务
# 使用完毕后退出登录即可关闭 SSH 隧道
```