Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,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 5.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[9,273 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 whomever posted them. This site is not responsible for what they say.
Control multiple ssh connections via a master Terminal
Authored by: kiltbear on Wed, Apr 8 2009 at 9:34AM PDT
I am a very very happy kilted-geek-bear today! Thanks!

[ Reply to This | # ]
iTerm comes with this functionality
Authored by: terryray on Wed, Apr 8 2009 at 11:04AM PDT
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 Wed, Apr 8 2009 at 2:00PM PDT
Yes - very nice! Thanks for sharing!

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

[ Reply to This | # ]
Multi-screen bug
Authored by: lullabud on Wed, Apr 8 2009 at 2:32PM PDT
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 Wed, Apr 8 2009 at 3:16PM PDT
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 Wed, Apr 8 2009 at 11:17PM PDT
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 Thu, Apr 9 2009 at 8:04AM PDT
Multi-screen bug
Authored by: bazcurtis on Thu, Apr 9 2009 at 1:17AM PDT
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 Thu, Apr 9 2009 at 8:06AM PDT
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 Thu, Apr 9 2009 at 9:08AM PDT
Perfect, thanks for that. Working now.

Best wishes

Michael


[ Reply to This | # ]
Multi-screen bug
Authored by: woodgie on Thu, Apr 9 2009 at 8:24AM PDT
You probably need to chmod it to have execute permissions (chmod 755)

[ Reply to This | # ]
Multi-screen bug
Authored by: woodgie on Thu, Apr 9 2009 at 8:26AM PDT
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 | # ]