
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 05:36 AM
In my custom pattern I need to run a script file on a Linux server. The file gets uploaded in my pattern via MID-server but the file needs to be executed as user_x.
But I just found out that I can't switch user using sudo su user_x command and that I need to run it like this:
sudo -u user_x myUploadedFile.sh
How is that done in the pattern? Here are my steps:
So, what do I do in step 3 to execute the file using the sudo -u command?
Thanks!
Edit: Found this thread, and it's basically the same but without a resolution. Adding the sudo -u command in the file did not solve the issue. Running a command on linux under sudo -u
Solved! Go to Solution.
- Labels:
-
Discovery

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 12:24 PM
Ok. So I asked around and got some feedback and tried a new approach and it seems to be doing what I want. Here's a screen shot of what the step in pattern looks like:
The output from Discovery Log gives me this:
Parse Command Output
2020-10-15 21:09:09: Executing SSH command: sudo -u <user_x> "/tmp/<foldername>/myUploadedFile.sh"
2020-10-15 21:09:11: Command result: sudo: unable to execute /tmp/<foldername>/myUploadedFile.sh: Permission denied
2020-10-15 21:09:11: Command failed with status 1
2020-10-15 21:09:11: Execution time: 2235 ms
I need to make sure correct permissions are set to file but this looks promising!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 06:58 AM
Hi
We had a previous conversation here below, where I suggested some recommendation.
Just checking if this had helped you?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 07:18 AM
Hi and thanks for helping out. Unfortunetly I can not run that command since it's locked down. I need to run the sudo -u command as the discovery user.
By the way, It seems that you posted the same link 4 times š
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 07:01 AM
Hi
We had a same discussion here, jus want to check whether this had helped you in any way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā10-15-2020 07:02 AM
Hi
Did you get to check this, we had a discussion reg the same.