This commit is contained in:
2021-11-14 15:52:46 +08:00
parent 915c231124
commit 1e344dc204
112 changed files with 1039 additions and 1039 deletions

View File

@@ -7,7 +7,7 @@ tags: ["ssh", "隧道", "转发"]
categories: ["shell"]
---
# sshd 常规设置
## sshd 常规设置
- 禁用 root 远程登陆
```
PermitRootLogin no
@@ -27,12 +27,12 @@ categories: ["shell"]
ClientAliveCountMax 3
```
# ssh 参数
## ssh 参数
- -f 后台运行
- -N 仅作端口转发,不执行任何命令
- -g 绑定端口到全部网卡
# 本地定向转发
## 本地定向转发
- ssh-client 不可达 remote-host, ssh-server 可达 remote-host, ssh 隧道映射 ssh-client 指定端口到 remote-host 指定端口
- 在 ssh-client 执行
```bash
@@ -41,7 +41,7 @@ categories: ["shell"]
username@<ssh-server>
```
# 远程定向转发
## 远程定向转发
- ssh-client 可达 remote-host, ssh-server 不可达 remote-host, ssh 隧道映射 ssh-server 指定端口到 remote-host 指定端口
- 在 ssh-client 执行
```bash
@@ -50,7 +50,7 @@ categories: ["shell"]
username@<ssh-server>
```
# 动态转发
## 动态转发
- SOCKS5 代理
- 在 ssh-client 执行
```bash