Skip to content

Instantly share code, notes, and snippets.

@dipu-bd
Last active July 12, 2019 14:58
Show Gist options
  • Save dipu-bd/58bda452dba49b6ed9c9cb160b8d9dbc to your computer and use it in GitHub Desktop.
Save dipu-bd/58bda452dba49b6ed9c9cb160b8d9dbc to your computer and use it in GitHub Desktop.
Configure ssh for to use a proxy to connect to target server
Host proxy # A name for the proxy server
Hostname <PROXY_SERVER_IP> # Provide the IP address of the proxy server
User root # The user to connect to in proxy server
Host targetA # A name to access to the Target Server A
ProxyCommand ssh -q proxy nc -q0 <TARGET_A_SERVER_IP> 22
Host targetB # A name to access to the Target Server B
ProxyCommand ssh -q proxy nc -q0 <TARGET_B_SERVER_IP> 22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment