I'm trying to write, in essence, an automatic deployment script for use by our development team and I know I can set up SSH to use keys so that I can automatically authenticate via key instead of password for the purposes of executing remote commands; however, what I'm stuck on is that the task that needs to execute for deployment requires us to restart an upstart job which requires root privileges. I've looked around on the internet (and here) and have been mostly unsuccessful and finding solutions.The question: Is there a way to remotely (and automatically, the script is not monitored so password authentication as sudo requires will not work) elevate to root privileges to restart a job or give a user group the ability to do that?Overall I would still consider myself a newbie Linux user, I haven't done a lot of work with permissions but I've learned my way around operations pretty well.
How do you automatically elevate an automatic task to root privileges or is there an alternative approach?
scripting;sudo;authentication
You can enable password-less sudo for a specific command.# /etc/sudoers (edit with visudo)# For a specific user/command comboizuriel ALL=NOPASSWD:/bin/true# For a specific command, any user in group sudo.%sudo ALL=NOPASSWD:/bin/true