csshX: Massive Ssh Administration

| Comments

A couple of moths ago I came across the excellent application that is csshX

Nowadays massive administration is not, or should not be, based in direct connections to client computers. There are many reasons for this being the most obvious, I think, having to have the client computers online or the fact of having a possibility of someone else accessing by the same “backdoor” if you want to call it.

But today I want to explain how to use this tool, as it might come in handy at some point for some specific task. If you use ARD in your day to day tasks this is comparable, but more interactive and far more geeky (:

The whole idea is simple, csshX will allow you to connect remotely to n number of computers via ssh and give you a central console to send command to all the hosts at the same time.

The installation is plain simple, just download the tgz, uncompress and copy it to /usr/local/bin/ . Now let’s say that you have 5 server sitting in a subnet somewhere and you need to administer them. You can run this to connect to all of them

bash-3.2$ csshX --login mysuperuser --ping_test 3 10.172.16.[1-5]

If this is the first time you ssh to your server you might need to accept the ssh keys. Then type the password and you’re in! You can now for example grep the logs and search for a specific string and see all the results at once. Or maybe apply a specific update from the command line.  Another option is to save the hosts in a file with one line per host and pass the hosts file to the -hosts switch. You can specify different usernames per host, pass commands to initialize your sessions. Perhaps saving one host file per each lab you need to administer

As you can see the tool is plain simple but  versatile enough. This is how you manage OSX *nix style. You can even get more unix and take a look to cssh for OSX or for your Linux distro.

Final note, as mentioned above this active tools have their downsides, maybe a policy in your company limits this kind of uses. In any case and when it comes to administer OSX computers I’d recommend you get into using Puppet, Munki, Casper, Filewave… Organizing and centralizing your logs with Graylog2, Logstash, Splunk>…