Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

There's a tool called cssh for linux that has simular use to what I'd like to have on Windows. Basically I'm logging into servers that are identical to each other and I'd like to be able to type the same thing in both windows at the same time to look at logs, do various greps, etc.

share|improve this question

4 Answers 4

PuTTY Command Sender is what you're looking for.

share|improve this answer
    
I've used this, but it seems like one window has a definite lag... it's more noticeable when autocomplete is turned on. On one window, I get the autocompleted commands I expect, on the other I get just the letters I typed during autocomplete unless I go extremely slowly. Is this just me? –  Alex Argo Aug 5 '10 at 13:59

You could always install clusterssh via CygWin (a UNIX compatible shell for Windows)... (you can google for more information about the two)...

share|improve this answer

I have recently figure out a way to do this easily. I used an excel sheet to build cmd commands including putty ssh log-in then copy past the columns in a cmd window. it works like magic even if you have to customize the command for each server.

cmd Command         ip          user name           password            Command template

echo  /snmp set enabled=yes >temp\10.10.0.9.txt| putty -ssh user_name@10.10.0.9 -pw passwd -m temp\10.10.0.9.txt        10.10.0.9           user_name           passwd      /snmp set enabled=yes

echo  /snmp set enabled=yes >temp\10.10.0.31.txt| putty -ssh user_name2@10.10.0.31 -pw passwd2 -m temp\10.10.0.31.txt   10.10.0.31          user_name2                  passwd2     /snmp set enabled=yes

if you want to run the exact command list on every machine then you save it to a file and use another sheet to generate the command-line batch.

cmd Command         ip          user name           password
putty -ssh user_name@192.168.0.21 -pw paaswd -m commands.txt          192.168.0.21          user_name           paaswd
putty -ssh user_name@192.168.0.22 -pw paaswd -m commands.txt                192.168.0.22        user_name           paaswd

you will need to create a folder named temp inside putty main folder and you might need to customize putty logging to save a file per ip or pear session. this is my first post here so I cant upload images.

share|improve this answer

In addition to using clusterssh or mtputty, a simpile bash script can login to a list of remote servers using ssh, copy a file to each using scp and execute a script on each of the servers. I'm a bash scripting novice so likely not the most efficient or best option but seems to be pretty easy to manage. I've found it easier than both clusterssh and mtputty. Save this code into a file named copyFileToServers.sh, create a serverlist file that has a list of ips or server names and execute by typeing ./copyFileToServers.sh.

You'll need cygwin on windows (which is the only place i've tested this). You will have to install sshpass (i know people really hate this package but i was too lazy to get ssh keys going on all the servers) separately which can be downloaded from sourceforge.

One thing to note, you'll have to login using ssh user@remomte_server from the command line of your admin machine for each server you want to manage. sshpass doesnt work until you have manually acknowledged adding the ssh key for the remote servers. You only need to do this once.

(note: I wasn't able to get clusterssh running on windows cygwin as of july 2014 so i couldn't really speak to how good/bad the program is at accomplishing what OP asked for.)

HOSTS=./serverlist
echo "what file should be copied to the remote servers?"
read file
echo "where should the file be placed on each remote server?"
read dest
echo "what script should be run on all remote nodes?"
read remoteScript
while read line

do
        if [ "${#file}" -gt 0 ] 
    then 
        sshpass -p 'password' scp $file root@$line:$dest 
    else 
        echo "skipping file copy" 
    fi
    if [ "${#remoteScript}" -gt 0 ] 
    then 
        sshpass -p 'password' ssh root@$line 'bash -s' < $remoteScript 
    else 
        echo "skipping remoteScript execution" 
    fi
    echo $line
done < $HOSTS
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.