Write a remote handling manuscript

I require to be able to in your area run a manuscript that will certainly connect to numerous web servers and also run commands on them. What is the most effective means to complete this?

0
2019-05-06 22:43:52
Source Share
Answers: 7

I would certainly make use of ssh with key verification, I think ssh has a means to see to it that particular accounts can just visit from particular IP's so I would certainly restrict it to that due to the fact that you could not intend to set a passphrase on the keys (you can make use of a key supervisor to stay clear of that yet it has constraints also)

0
2019-05-08 19:48:29
Source

Personally, I would certainly make use of Capistrano. It's pleasant and also created in Ruby and also they currently did every one of the hefty training for you.

From Wikipedia :

Capistrano is an energy and also structure for implementing commands in parallel on numerous remote equipments, using SSH.

0
2019-05-08 19:48:21
Source

you can run a command making use of ssh hostname command. If you have a whole manuscript you require to execute, first usage scp to move it to the remote host, after that ssh to execute it.

scp script.sh host:script.sh
ssh host ./script.sh
0
2019-05-08 19:48:02
Source

What concerning making use of arrangement monitoring like puppet or chef? This is possibly a little over the top for just one manuscript, yet if you require numerous such manuscripts it could be worth to take into consideration.

0
2019-05-08 19:47:27
Source

A quickie bash 'for' loop could be most convenient, probably something like :

for h in host1 host2 host3
do 
   echo $h
   ssh [email protected]$h "ps -ef"
done

Certainly, cfengine/puppet/chef/ capistrano are far better arrangement monitoring alternatives. If you intended to interactively send commands to the numerous coverings, clusterm (http :// sourceforge.net/projects/clusterm/) is a strong selection also.

0
2019-05-08 12:09:17
Source

Puppet and also Chef are "draw" systems and also I've located that a corresponding "push" system applied making use of Capistrano, Fabric, or ssh (1) in a for - loop is essential. Certainly, that suggests public type in area for verification, also ; the good news is, those can be taken care of by Puppet or Chef.

0
2019-05-08 11:56:54
Source

I have actually been rather satisfied with a covering script called dssh.sh that makes use of ssh to connect with several equipments all at once. It can execute the very same command throughout great deals of equipments all at once and also await them all to exit prior to returning. To download and install and also discover more concerning it, the most effective reference I have actually located is the BASH Cures Cancer blog.

0
2019-05-08 09:46:25
Source