i2cssh で踏み台経由のログインを行う

投稿者: ytyng 3年, 8ヶ月 前

i2cssh は、iterm2 で複数サーバに同時にログインし、SSHペインを自動的に並べて同時操作ができるようになるツールです。

https://github.com/wouterdebie/i2cssh

複数操作する対象のサーバに、同じ踏み台経由でログインするには

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

とします。

python fabric でやるなら

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

こんな感じですね

現在未評価

コメント

アーカイブ

2024
2023
2022
2021
2020
2019
2018
2017
2016
2015
2014
2013
2012
2011