System Center Orchestrator Run SSH Command - sudo problem


Has anyone experience with the run ssh command activity in orchestrator.

I want to use this to automatic cleanup some files on linux machines. I use a username and key file, but we need to do a sudo su - to use this account to delete some files.

When adding this command as first line of our command set file the runbook hangs.

How can I do this?

Kind regards,


su will prompt for a password to elevate to root. I would recommend using sudo instead. I think you need only configure the sudoers file to allow specific commands. Then simply issue the commands preceded with sudo. This is assuming that you have authentication all figured out with your keyfile so the user is not prompted for a password to login/connect.

How to configure the sudoers file is beyond the scope here but there are plenty of guides out on the innerwebs.
Example, assuming sudoers is configured to allow the ‘rm’ command for the user account:

sudo rm -rf /tmp/junkfiles/*.*

BTW, not a linux expert but I know enough to be dangerous.

Have you tried using the security tab on the activity to run it as the other account?