How to install something from one computer to all computer?

Solution 1:

For this, my preferred solution is Ansible (https://www.ansible.com/). It let's you automate any kind of configuration or installation across as many computers as you could possibly want. Another upside to Ansible is the community which has already made a lot of robust scripts available, for performing most configuration and installation tasks.

This looks like a fairly comprehensible tutorial to get you up and running with Ansible.

However, if this is just a one-off command you want to run on multiple computers, you're better off just scripting it in Bash.

Solution 2:

If it is just a couple of simple commands you need to execute and you don't want to configure complex automation software (like ansible, salt or puppet) you could use clusterssh.

Open a command line window to install

sudo apt-get install clusterssh

now you can open a connection to a number of hosts, like this

clusterssh -l username labhost1 labhost2 labhost3

clusterssh will then give you a window to enter your commands, but also one terminal window for each host you connect to - so you can see what actually happens!

ClusterSSH example In this example, you can see the command window with "apt-get update" to the right and all the cluster terminals to the left.

Should one of the hosts have an issue, you can see the error message immediately and click on the corresponding terminal to remedy the situation.

You can also write a list for clusterssh to connect to: Open your favorite editor and write to $HOME/.clusterssh/clusters

collegelab labhost1
collegelab labhost2
collegelab labhost3

then connect with

clusterssh -l username collegelab

Further reading

  • Man Page