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. You'll need cygwin on windows (which is the only place i've tested this). 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. I've found it easier than both clusterssh and mtputty. I'm a bash scripting novice so likely not the most efficient or best option but seems to be pretty easy to manage. 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. this is my first post here so I cant upload images. 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. Putty -ssh -pw paaswd -m commands.txt 192.168.0.22 user_name paaswd Putty -ssh -pw paaswd -m commands.txt 192.168.0.21 user_name paaswd 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 Command templateĮcho /snmp set enabled=yes >temp\10.10.0.9.txt| putty -ssh -pw passwd -m temp\10.10.0.9.txt 10.10.0.9 user_name passwd /snmp set enabled=yesĮcho /snmp set enabled=yes >temp\10.10.0.31.txt| putty -ssh -pw passwd2 -m temp\10.10.0.31.txt 10.10.0.31 user_name2 passwd2 /snmp set enabled=yes it works like magic even if you have to customize the command for each server. I used an excel sheet to build cmd commands including putty ssh log-in then copy past the columns in a cmd window. I have recently figure out a way to do this easily.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |