parent
9b36937a5d
commit
518505b398
|
@ -230,3 +230,19 @@ UserKnownHostsFile /dev/null
|
||||||
```
|
```
|
||||||
|
|
||||||
*关闭授权验证将增加 SSH 的安全隐患。*
|
*关闭授权验证将增加 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 隧道
|
||||||
|
```
|
||||||
|
|
Loading…
Reference in New Issue