I want to run script B on machine B by a call from script A on machine A that is run by crontab on regular interval. I'm not a unix user myself and after looking at similar questions, couple things are confusing to me.
Are single quotes necessary because I see they're sometimes used but sometimes not used.
ssh user@host './path/foo.sh' ssh user@host foo.sh
If I want to use variables will this work:A.sh:
path="some/path" ssh user@host @path/foo.sh
or do I need to put them in single quotes?
- Is password always needed? The answers at how to run a script file remotely using ssh had no mention of passwords at all, so I was wondering if there are types of scripts that require password and those that don't. Since my script will have to run on schedule, I would need to automate the authentication process. I found several solutions that involve expect scripts, key-pair authentication. But some answers that have no mention of passwords have me questioning whether if they're necessary at all.