title: write a shell script to ssh to a remote machine and execute commands
body: <p>I have two questions:</p>
  
  <ol>
  <li>There are multiple remote linux machines, and I need to write a shell script which will execute the same set of commands in each machine. (Including some sudo operations). How can this be done using shell scripting? </li>
  <li>When ssh'ing to the remote machine, how to handle when it prompts for RSA fingerprint authentication. </li>
  </ol>
  
  <p>The remote machines are VMs created on the run and I just have their IPs. So, I cant place a script file beforehand in those machines and execute them from my machine.</p>