---
slug: "i2cssh-bastion-xt"
title: "Logging in via Jump Host with i2cssh"
description: "Configure `~/.i2csshrc` so the `i2cssh` command can fan out SSH connections through a bastion / jump host to multiple servers."
url: "https://www.ytyng.com/en/blog/i2cssh-bastion-xt"
publish_date: "2020-08-21T08:19:48Z"
created: "2020-08-21T08:19:48Z"
updated: "2026-05-11T13:09:12.083Z"
categories: ["mac"]
keywords: ""
featured_image_url: "https://media.ytyng.com/resize/20230812/dfecc26041724eb0ac51d3712333d3a9.png.webp?width=768"
has_video: false
has_music: false
video_urls: []
music_urls: []
lang: "en"
---

# Logging in via Jump Host with i2cssh

<p>i2cssh is a tool that allows you to log in to multiple servers simultaneously in iTerm2, arranging SSH panes automatically for simultaneous operations.</p>
<p><a href="https://github.com/wouterdebie/i2cssh">https://github.com/wouterdebie/i2cssh</a></p>
<p></p>
<p>To log in to multiple target servers via the same bastion host, you can use:</p>
<pre>i2cssh -Xt=user@bastion.example.com "ssh <a href="mailto:user@server1.example.com&quot;">user@server1.example.com"</a> "ssh <a href="mailto:user@server2.example.com&quot;">user@server2.example.com"</a></pre>
<p>like this.</p>
<p></p>
<p>If you are using Python Fabric, you can do it like this:</p>
<pre><span>if </span><span>getattr</span>(env, <span>'gateway'</span>):<br />    local(<span>'i2cssh -Xt={} {}'</span>.format(<br />        env.gateway,<br />        <span>' '</span>.join(<span>'"ssh {}@{}"'</span>.format(env.user, h)<br />                 <span>for </span>h <span>in </span>env.hosts)))</pre>
<p></p>
<p>It looks something like this.</p>
