Use ssh on multiple servers at one time

Posted by rodo on Thu 4 Oct 2007 at 11:07

Lots of us have many server to manage and we perform the same tasks on each of the machine every day, if you want to save time the package cssh will make you happy!

Simply install the clusterssh package:

host:/# apt-get install clusterssh

Now if you want to perform the same command on the three servers one, two, & three simply run:

host:/# cssh one two three

This will open three console, one for each server, over an ssh connection, and one little console to type your command.

Enjoy !

 

 


Posted by vegiVamp (195.177.xx.xx) on Thu 4 Oct 2007 at 14:06
If you're using KDE, just use Konsole, open a tab for each server, and on the tab you'er working on, click 'Send input to all sessions'.

[ Parent | Reply to this comment ]

Posted by drgraefy (74.66.xx.xx) on Thu 4 Oct 2007 at 15:11
[ View Weblogs ]
mrxvt, "a multi-tabbed color vt102 terminal", allows you to broadcast to all tabbed terminals as well.

[ Parent | Reply to this comment ]

Posted by Anonymous (65.96.xx.xx) on Thu 4 Oct 2007 at 16:37
It's much more useful, though, to create a .csshrc and add in some named groups...

man cssh of course, for details.

[ Parent | Reply to this comment ]

Posted by Anonymous (130.238.xx.xx) on Thu 4 Oct 2007 at 16:45
It's pity that cssh does not seem to care about ~/.ssh/config where one can easily specify abbreviations for different ssh-servers and their users and ports.

[ Parent | Reply to this comment ]

Posted by BackSeat (82.152.xx.xx) on Mon 8 Oct 2007 at 00:07
cssh -i

...will allow you to use abbreviations defined in ~/.ssh/config

BS

[ Parent | Reply to this comment ]

Posted by Anonymous (75.31.xx.xx) on Thu 4 Oct 2007 at 18:07
Bill Stearns has a similar program on his website called fanout; for terminals, fanterm can be pretty great. As with all remote ssh tricks, it really helps to either have ssh-agent or no passphrase configured. Distributing your keys can be a real chore in a large environment.

http://www.stearns.org

[ Parent | Reply to this comment ]

Posted by Anonymous (192.154.xx.xx) on Thu 4 Oct 2007 at 18:36
I've used cssh for as many as 25 concurrent ssh logins to admin a Debian lab (vmware-config.pl on all machines). Pretty responsive. Plus, I got to see what was happening in all 25 sessions (not possible if they are hiding behind tabs in konsole).

[ Parent | Reply to this comment ]

Posted by vegiVamp (195.177.xx.xx) on Fri 5 Oct 2007 at 07:51
I wonder how much screen estate you've got to be able to get meaningful viewports on 25 terminal windows...

[ Parent | Reply to this comment ]

Posted by sytoka (213.103.xx.xx) on Fri 5 Oct 2007 at 21:55
I upgrade more than 40 computer in parallel witch clusterssh and it's ok. I have two screen 1280x1024 and I use the wmii windows manager.

[ Parent | Reply to this comment ]

Posted by oDn (83.113.xx.xx) on Thu 4 Oct 2007 at 20:37
Another alternative for people who wish to use no-gui tools, is dsh (Distributed Shell).

Very powerful and useful tool although a bit of a pain to identify which output comes from which host.

[ Parent | Reply to this comment ]

Posted by Anonymous (67.88.xx.xx) on Thu 4 Oct 2007 at 21:57
I have been looking for this!! I have Konsole but wanted a cmd line tool. Nice.

[ Parent | Reply to this comment ]

Posted by Anonymous (82.235.xx.xx) on Thu 4 Oct 2007 at 23:46
Use the -M option !
There will be the machine name as prefix of all output lines.

[ Parent | Reply to this comment ]

Posted by oDn (83.113.xx.xx) on Fri 5 Oct 2007 at 17:04
How could I even miss that out ! I probably went through the man pages a little too quickly it seems.
Cheers for the tip ;)

[ Parent | Reply to this comment ]

Posted by Anonymous (84.249.xx.xx) on Fri 5 Oct 2007 at 14:41

[ Parent | Reply to this comment ]

Posted by oDn (83.113.xx.xx) on Fri 5 Oct 2007 at 18:03
Hi there,

would you have any advice on how to get pssh running on debian sarge.
I'm quite interested by what pscp has to offer.

I seem to be having some trouble getting this to run with either python2.3 or python 2.4.

Cheers

[ Parent | Reply to this comment ]

Posted by Anonymous (195.221.xx.xx) on Fri 5 Oct 2007 at 15:15
pdsh do the same, without oppening a new shell.

[ Parent | Reply to this comment ]

Posted by endecotp (86.6.xx.xx) on Fri 5 Oct 2007 at 16:25
[ View Weblogs ]
Yet another solution is Omnitty. It is a curses app and has some kind of list of machines down the left hand side where those that have new output are highlighted.

[ Parent | Reply to this comment ]

Posted by Anonymous (62.147.xx.xx) on Sat 6 Oct 2007 at 10:23
We are using this tool to administrate our clusters and to be very efficient:

http://taktuk.gforge.inria.fr/

taktuk package is in Debian and is very fast (to be quick: ssh are not made only by the server but by the other nodes also. So you have a tree based ssh connections).

So if you have a large amount of computers to contact, enjoy...

[ Parent | Reply to this comment ]

Posted by sneex (63.139.xx.xx) on Fri 12 Oct 2007 at 16:34
[ View sneex's Scratchpad | View Weblogs ]
There is also something I recently discovered called Nile:
http://nile.ifae.es/FAQ.html

Cheers!
-Sx-

--
http://youve-reached-the.endoftheinternet.org/

[ Parent | Reply to this comment ]

Posted by Anonymous (128.197.xx.xx) on Tue 16 Oct 2007 at 12:58
I'm using the diligence/distributed shell (dish) to manage and monitor applications on a huge number of servers. It is very flexible (ssh/scp/rsh/telnet/sqlplus etc.), runs via normal user accounts, and can process hundreds of hosts in few seconds.

http://dish.mirendom.net

[ Parent | Reply to this comment ]

Posted by serkanokter (88.245.xx.xx) on Tue 23 Oct 2007 at 16:38
For easy use,

write your /etc/clusters & ~/.csshrc files which is described as below :

cluster1 username@hostname1 username@hostname2 ....

and save it. After that add that hosts' ip4 address and hostnames to /etc/hosts. Open cssh via terminal ( for debugging) and click Hosts from menu and Add Hosts.
Write cluster1 to text box and OK.

I used cssh for our test client machines.

Thanks
** Serkan OKTER **

[ Parent | Reply to this comment ]

Posted by Anonymous (85.183.xx.xx) on Thu 19 Jun 2014 at 15:02
terminator allows grouping, use for ssh or for local commands as well

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

What do you use for configuration management?








( 489 votes ~ 5 comments )