I'm trying to setup a programming environment to 14 students using Virtualbox. I have created all the individual machines but now I need to perform remote installs on every machine and I am trying to do it with a ssh script but I'm running in to several problems but my main one is that I can't login as root so I have to use a normal user and perform sudo. Every machine has the user for the student and a super user common to all.
So what I would like is to automate something like this but getting the server list from a file
ssh firstname.lastname@example.org "echo 'password' | sudo -S ls /home/; sudo apt-get -y install vim;"
A better example is I need to push an updated hosts config to all the student machines
PS: I know I could have installed the software before I created the machine but the purpose of this exercise is to allow every student to do a full install from a basic debian installation