Logging in via Jump Host with i2cssh

mac
2020-08-21 08:19 (5 years ago)
Logging in via Jump Host with i2cssh

i2cssh is a tool that allows you to log in to multiple servers simultaneously in iTerm2, arranging SSH panes automatically for simultaneous operations.

https://github.com/wouterdebie/i2cssh

To log in to multiple target servers via the same bastion host, you can use:

i2cssh -Xt=user@bastion.example.com "ssh user@server1.example.com" "ssh user@server2.example.com"

like this.

If you are using Python Fabric, you can do it like this:

if getattr(env, 'gateway'):
local('i2cssh -Xt={} {}'.format(
env.gateway,
' '.join('"ssh {}@{}"'.format(env.user, h)
for h in env.hosts)))

It looks something like this.

Please rate this article
Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.

Categories

Archive