ssh登录时自动端口转发和反向隧道操作

ssh登录时自动端口转发和反向隧道操作

1
2
3
4
5
6
7
8
9
cat - >> ~/.ssh/config <<'EOF'
host opencode
User root
HostName 公网IP
LocalForward 18789 localhost:18789
RemoteForward 10808 localhost:10808
ServerAliveInterval 60
IdentityFile    ~/.ssh/id_rsa
EOF
  • 18789是端口转发,将远程端口转发到本地
  • 10808是反向隧道,将本地端口转发到远程
comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计