Seemless ssh through jumpboxes & bastion hosts
- Add the following to the top of your ssh config file found at
~/.ssh/config
:
Host *
IgnoreUnknown JumpHost
Note: The
IgnoreUnknown
option can take multiple values using comma sperated values
- Add entries for the jumpboxes/bastion hosts. Minimum configuration needed is
Hostname
andUser
.
Example:
Host myJumpHost
Hostname 192.168.1.1
User admin
- Add the
JumpHost
option to the hosts that require a jumpbox for connections. This is the host that will receive an interactive shell.
Note: If the hosts entry does not exist, create it. Minimum configuration needed is
Hostname
,User
andJumpHost
.
Example:
Host myHost
Hostname 192.168.1.20
User admin
IdentityFile ~/.ssh/my_keyfile
JumpHost myJumpHost
- Connect with
jssh
using:/path/to/jssh myHost
Note: You can append
debug
to the above command for debugging information. No other options are available at this time
jssh
is prebuilt for Windows and Linux x86 machines. For Mac's and/or ARM based machines, build a standalone binary with:
git clone https://github.com/steveharsant/jssh
cd jssh
pip install -r requirements.txt
pyinstaller --onefile ./jssh.py
The binary will be found in the ./dist
directory once built.