jmunsch

bash run script on multiple machines

May 20th, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.70 KB | None | 0 0
  1. #---------------------------------------------------------------------------
  2. # sshpass allows to run remote commands
  3. # for example
  4. #while read ip; do
  5. #  echo -n "$ip: " >> local_file.log;
  6. #  sshpass -p 'your password' ssh user@$ip remote_command >> local_file.log
  7. #done < ips.txt
  8. # ips.txt would be an ip address per line
  9. #---------------------------------------------------------------------------
  10. sudo apt-get install sshpass
  11. # ufw is for firewall port 22 is for ssh
  12. sudo ufw allow 22
  13. sudo apt-get install openssh-server
  14. # this sets the default configs for ssh
  15. sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
  16. # this makes it runnable or something
  17. sudo chmod a-w /etc/ssh/sshd_config.original
Advertisement
Add Comment
Please, Sign In to add comment