During the course of review I noticed How can I avoid having to enter a password for an scp command by hard-coding the password into my script? sudodus asked some good questions in the comments and was providing what looked to me like valuable information. I encouraged an answer, meanwhile this question was closed as a duplicate of Run Bash Script as Root which to me doesn't appear to be a very good fit. I've voted to reopen in the hope that a quality answer can be provided. Does this seem to be a course of action the community can support?