Skip to content

Instantly share code, notes, and snippets.

@josephphyo
Last active December 29, 2021 14:24
Show Gist options
  • Save josephphyo/0676feb282a831d79db35c4b3edbcd2d to your computer and use it in GitHub Desktop.
Save josephphyo/0676feb282a831d79db35c4b3edbcd2d to your computer and use it in GitHub Desktop.
Jump Private Server Via Bastion Host Single Hop (Linux or Mac Host)
<< Add Config to sshd config - ~/.ssh/config >>
# vim ~/.ssh/config
=====================================
### Bastion Host Jump Config
## Private Server
Host private-server-1
HostName 192.168.1.2
User ubuntu
IdentityFile /path/private_key.pem
ProxyJump bastion
Host private-server-2
HostName 192.168.1.3
User ubuntu
IdentityFile /path/private_key.pem
ProxyJump bastion
## Bastion Server
Host bastion
HostName 192.168.1.1
User ubuntu
IdentityFile /path/bastion_key.pem
=====================================
<< Login Commad >>
# ssh private-server-1
# ssh private-server-2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment