• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ClusterSSH(cssh) – Manage Multiple SSH Sessions on Linux

by admin

ClusterSSH(cssh) is a cluster administration tool, it is used to make the same change on multiple Linux servers at the same time. ClusterSSH(cssh) controls a number of xterm windows via a single graphical console window to allow commands to be interactively run on multiple Linux servers over an ssh or rsh connection.

Cssh command opens an administration console and an xterm to all specified hosts. Any text typed into the administration console is replicated to all windows. All windows may also be typed into directly.

Installation of ClusterSSH on Ubuntu

Use the apt-get command to install required package:

# sudo apt-get install clusterssh

Installation of ClusterSSH on CentOS/RHEL/Fedora

To install ClusterSSH on CentOS/RHEL/Fedora, first set up EPEL repository, and then run the below Command:

# yum install clusterssh

After installation, define the cluster of hosts that we want to run commands on. To do this, create a system-wide ClusterSSH configuration file as follows.

# sudo vi /etc/clusters

ClusterSSH(cssh) – Manage Multiple SSH Sessions on Linux

If we want a user-specific ClusterSSH configuration, simply use ~/.csshrc instead of /etc/clusters. In the above example, I define two clusters: nsit_cluster1, nsit_cluster2 along with hosts.

Example 1: To launch ClusterSSH, run cssh command as follows.

# cssh -l root nsit_cluster1

In the above command, ‘root’ is the login ID for all the hosts in the cluster, and ‘nsit_cluster1’ is the cluster name.

Clusterssh cssh

Example 2: Individual hostname instead of the cluster name.

# cssh -l root mail1.nsitmail.com mail2.nsitmail.com mail3.nsitmail.com

In the Above command, just replace the hostname according to your environment.

Filed Under: Linux, Ubuntu

Some more articles you might also be interested in …

  1. Understanding the Network interface configuration file /etc/sysconfig/network-scripts/ifcfg-eth#
  2. How to set children-max for udev Service in CentOS/RHEL 7
  3. What is the purpose of utmp, wtmp and btmp files in Linux
  4. How to enable core dump for Applications on CentOS/RHEL
  5. Linux rsync command with practical examples
  6. 10pt loadable: Metric (TFM) file not found
  7. Log watching using tail or less
  8. How to control resource (cgroup) with systemd for user process group in CentOS/RHEL 7
  9. How to Disable “alt+ctrl+Del” Key Combination causing reboot in CentOS/RHEL 4,5
  10. iostat Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • vgextend Command Examples in Linux
  • setpci command – configure PCI device
  • db_load command – generate db database
  • bsdtar command – Read and write tape archive files

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright