You've already forked www.colben.cn
update
This commit is contained in:
@@ -7,17 +7,8 @@ tags: ["ssh", "隧道", "转发"]
|
||||
categories: ["shell"]
|
||||
---
|
||||
|
||||
## sshd 常规设置
|
||||
- 禁用 root 远程登陆
|
||||
```
|
||||
PermitRootLogin no
|
||||
```
|
||||
- 只允许私钥登陆
|
||||
```
|
||||
PubkeyAuthentication yes
|
||||
PasswordAuthentication no
|
||||
```
|
||||
- 开启端口转发功能
|
||||
## 开启端口转发配置
|
||||
- 修改 sshd 配置
|
||||
```
|
||||
AllowTcpForwarding yes
|
||||
GatewayPorts yes
|
||||
@@ -27,7 +18,7 @@ categories: ["shell"]
|
||||
ClientAliveCountMax 3
|
||||
```
|
||||
|
||||
## ssh 参数
|
||||
## ssh 转发用到的参数
|
||||
- -f 后台运行
|
||||
- -N 仅作端口转发,不执行任何命令
|
||||
- -g 绑定端口到全部网卡
|
||||
|
||||
Reference in New Issue
Block a user