Skip to content

Instantly share code, notes, and snippets.

@alknopfler
Last active June 4, 2023 21:02
Show Gist options
  • Save alknopfler/98740f31076f91bf80e41de6af99e49f to your computer and use it in GitHub Desktop.
Save alknopfler/98740f31076f91bf80e41de6af99e49f to your computer and use it in GitHub Desktop.
SSH config file example

.ssh/config file examples

Dynamic port redirection

Host <destiny_name>
 Hostname 10.x.x.x # hostname or destiny ip
 User root
 DynamicForward 8000  # -D 8000
 IdentityFile ~/.ssh/albkey

Several jumphost

Bastion Node

Host jumphost
 Hostname destiny_hostname
 User root
 IdentityFile ~/.ssh/albkey

first destiny host

Host dest_host1
 Hostname ip_or_hostname_host1
 ProxyCommand ssh -W %h:%p jumphost
 User alberto

second destiny host

Host dest_host2
 Hostname ip_or_hostname_host2
 ProxyCommand ssh -W %h:%p jumphost
 User admalbertommed
 IdentityFile ~/.ssh/albkey2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment