Última actividad 10 months ago

此 SSH 設定根據目標 IP 或域名,透過不同的跳板機 (ProxyCommand) 進行連線,確保內外部網路存取的靈活性與自動化。

timmy revisó este gist 10 months ago. Ir a la revisión

Sin cambios

timmy revisó este gist 1 year ago. Ir a la revisión

1 file changed, 14 insertions

ssh_config(archivo creado)

@@ -0,0 +1,14 @@
1 + Host *.internal.local
2 + ProxyCommand bash -c 'timeout 3 nc -z %h %p || ssh -W %h:%p jump.internal.example.com'
3 +
4 + Host *
5 + ProxyCommand bash -c 'timeout 3 nc -z %h %p || ssh -W %h:%p jump.external.example.com'
6 +
7 + Host 192.168.0.*
8 + ProxyCommand bash -c 'timeout 3 nc -z %h %p || ssh -W %h:%p jump1.example.com'
9 +
10 + Host 172.16.*.*
11 + ProxyCommand bash -c 'timeout 3 nc -z %h %p || ssh -W %h:%p jump2.example.com'
12 +
13 + Host *
14 + ProxyCommand bash -c 'timeout 3 nc -z %h %p || ssh -W %h:%p fallback.jump.example.com'
Siguiente Anterior