I have a scropt that looks something like this:
#!/bin/bash
ssh user@domain1.com
sleep 10
some_command
exit
ssh different_user@domain2.com
sleep 10
some_command
exit
However, the script is not logging into those accounts and doing the actions. The accounts are configured in my local known_hosts and I can copy / paste the lines one by one into the CLI to do what I need. How do I get a script to log into remote servers and perform actions there?
Thanks!