Debian Admin - Your way to Debian World

November 29, 2007

ssh on multiple servers Using cluster ssh

by @ 10:28 am. Filed under General, Security

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

Cluster SSH opens terminal windows with connections to specified hosts and an administration console. Any text typed into the administration console is replicated to all other connected and active windows. This tool is intended for, but not limited to, cluster administration where the same configuration or commands must be run on each node within the cluster. Performing these commands all at once via this tool ensures all nodes are kept in sync.

Introduction

What is ClusterSSH and what is it used for?

Ever had to make the same change on more than one Linux/unix server? Find it annoyingly painful to keep repeating the exact same commands again and again and again?

This tool addresses exactly this problem. You run a utility (cssh) providing a number of server names as parameters, and then xterms opens up to each server with an extra “console” window. Anything typed into the console is replicated into each server window (so, for examples, you can edit the same file on N machines at the same time, or run the same commands with the same parameters across those servers).

It is also possible to type into the server windows directly, or temporarily disable replication to one or more of the servers through the “Hosts” menu.

Difference between ClusterSSH and “cssh”

The utility itself is called “cssh”. The project name is ClusterSSH. The project is not called “cssh” because when the project was first registered on SourceForge a project already existed using that name (”C sharp” unix shell).

Install cluster ssh on debian

#apt-get install clusterssh

Configuration Files

This /etc/clusters file is cluster tag database. Contains a list of tags and hostnames, in the form

<tag> [<username>@]hostname [...]

Newlines and comments (delimited with a #) are ignored.

Cluster definitions can also be added to the $HOME/.csshrc file

This /etc/csshrc file is Global configuration file, sourced by all users. Can be generated by:

cssh -u > /etc/csshrc

$HOME/.csshrc

Per user configuration file. Can be generated by:

cssh -u > /etc/csshrc</tt>

To add a cluster definition to this file, use the following format

cluster_tag1 = server1 server2 user@server3
cluster_tag2 = server4 server5
clusters = cluster_tag1 cluster_tag2

Be aware of using “reserved names” and no check is currently performed for them.

Using Cluster SSH

If you want to perform the same command on the three servers one, two, & three use the following command

# cssh one two three

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

Tags: , , , ,

You may also be interested in...

Leave a Reply

Subscribe RSS Feed

subscribe to the Debian Admin RSS feed

Internal links:

Sponsors:



Categories:

Support Debian Admin

Amount $:
Website(Optional):

Sponsors:

Archives:

WidgetBucks - Trend Watch - WidgetBucks.com

Related Links:


WidgetBucks - Trend Watch - WidgetBucks.com

Favourite Sites:

Wordpress Collection
Windows Reference
Ubuntu Geek
DebianHelp
All About Debian Tutorials
Power Electrical
Check Your IP Here
Debian,Ubuntu News
DebCentral
Tuxmachines
Capnkirby
Libervis
Nuxifield
Linux Horizon
Linux Appfinder
Debuntu
GNU/Linux For Everyone
Free Penguin
DebianAdmin is not related to the Debian Project.
This site is copyright © 2006,2007 Debian Admin
All Trademarks are the property of their respective owners.
The contents of this website may not be mirrored or archived without the express written permission of DebianAdmin Site Owner.

DISCLAIMER: All the information, troubleshooting methods, utilities offered in this website is provided AS-IS, without any warranties. Though I strive for perfection, and always test the validity and effectiveness of the troubleshooting content in various systems, I assume no responsibility for your use of these Fixes, Utilities and other troubleshooting advice. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. All use is completely at your own risk. Changes to the existing content and new additions are made to this website periodically, without notification.
Rodney's Kontera DynamiContext Plugin plugged in.