Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Control multiple ssh connections via a master Terminal UNIX
Many Unix users may be familiar with ClusterSSH. This tool allows you to open up ssh terminal sessions to many hosts (like when administering a cluster), and then send commands to all of the connected machines simultaneously. csshX is a free, open source tool inspired by ClusterSSH, but designed to work with the OS X Terminal.app (rather than X11's xterm). Once downloaded, the csshX script can be run where it is, or copied into /usr/local/bin/ (or any other directory on your path) for convenience.

The basic command line is:
csshX hostname1 hostname2 hostname3 [...]
This will open three Terminal windows, and ssh into hostname1, hostname2, and hostname3, connecting to one host per window. A fourth (red colored) controller Terminal window will also be opened (this screenshot demonstrates how things look). Any commands typed into the controller window will be sent to all three hosts. You can also send commands directly to only one of the host terminals by selecting its window directly.

For advanced use, menus can be brought up by pressing Control-A. These menus provide you with options such as disabling/enabling input to individual windows, minimizing all the windows, retiling the windows, etc.

[robg adds: This worked as described in testing with my, um, two-machine cluster, and I can see how this would be very useful for those working with a larger number of machines.]
    •    
  • Currently 2.20 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (10 votes cast)
 
[24,388 views]  

Control multiple ssh connections via a master Terminal | 12 comments | Create New Account
Click here to return to the 'Control multiple ssh connections via a master Terminal' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Control multiple ssh connections via a master Terminal
Authored by: kiltbear on Apr 08, '09 09:34:12AM

I am a very very happy kilted-geek-bear today! Thanks!



[ Reply to This | # ]
iTerm comes with this functionality
Authored by: terryray on Apr 08, '09 11:04:37AM
If you use iTerm, you may not know that it comes with this ability. Open up multiple tabs, and then hit the "Send Input to all Tabs" option in the Shell menu.

[ Reply to This | # ]
Control multiple ssh connections via a master Terminal
Authored by: Nem on Apr 08, '09 02:00:27PM

Yes - very nice! Thanks for sharing!

---
Nem W. Schlecht
http://geekmuse.net/



[ Reply to This | # ]
Multi-screen bug
Authored by: lullabud on Apr 08, '09 02:32:57PM

Using this with multiple monitors, I have found that it does not work. As soon as I unplug one of my monitors it works fine. Lame. =/



[ Reply to This | # ]
Multi-screen bug
Authored by: DaMacGuy on Apr 08, '09 03:16:44PM

Well, the first issue for me was the menu bar has to be on the left screen or it won't work. The next issue is that the terminal windows span both monitors. Hrrm. I'll keep an eye on it for later. Trying iTerm for now...

---
-DaMacGuy



[ Reply to This | # ]
Multi-screen bug
Authored by: brockgr on Apr 08, '09 11:17:26PM

I'm having a look at this, and I think I can sort this out in the next version.

Sadly some of us are not blessed with multi-monitor macs, and so this was not tested. :-)

.. Gavin



[ Reply to This | # ]
Multi-screen bug
Authored by: brockgr on Apr 09, '09 08:04:20AM
Multi-screen bug
Authored by: bazcurtis on Apr 09, '09 01:17:57AM

Hi,

I have been looking for this for sometime, but I get a permission denied when I try and run it. I have copied to /usr/local/bin, what have it missed?

Best wishes

Michael



[ Reply to This | # ]
Multi-screen bug
Authored by: brockgr on Apr 09, '09 08:06:21AM
Maybe it's a file permission issue? Maybe this would help:

chmod 755 /usr/local/bin/csshX

( http://code.google.com/p/csshx/wiki/FAQ#I_am_gettting_./csshX:_Permission_Denied. )

.. Gavin

[ Reply to This | # ]
Multi-screen bug
Authored by: bazcurtis on Apr 09, '09 09:08:02AM

Perfect, thanks for that. Working now.

Best wishes

Michael



[ Reply to This | # ]
Multi-screen bug
Authored by: woodgie on Apr 09, '09 08:24:26AM

You probably need to chmod it to have execute permissions (chmod 755)



[ Reply to This | # ]
Multi-screen bug
Authored by: woodgie on Apr 09, '09 08:26:02AM

OK, so I need to refresh the thread before commenting. Especially if it's been a while since I loaded the page...



[ Reply to This | # ]