0
votes
4answers
475 views

How to make bash script executable for a user, but not readable

I'm trying to run a script at login that will execute for a regular user, but not be readable by that or other non-root users. I've tried various things including chmod/chown combinations, as well as ...
0
votes
1answer
56 views

Allow user to run script as root, but not the individual commands within the script

I don't have much experience with this type of task and realize I need to get more familiar with the sudoers file. I want a user to be able to connect via ssh and run a script that performs a bunch ...
2
votes
1answer
221 views

Check if a file exists, using another user (sudo -u)

I want to check if a file exists [ -f /path/to/file ] using another user. So, I added: USER1 ALL=(USER2) /bin/mkdir, /usr/bin/git, /bin/echo to the sudoers file. The problem is, when I ...
2
votes
1answer
219 views

Sudoers CLI options

I'm working on a sudoers file. What is the correct way to state the following? Zero or more command line options, each starting with a single or double dash, followed by one or more characters. I ...
9
votes
8answers
18k views

using su inside of a shell script

I'm automating a deploy process and I want to be able to just call one .sh file on my machine, have it do my build and upload the .zip to the server and then do a bunch of stuff on the server. One of ...