<div dir="ltr">Hey Pavel,<div><br></div><div>Thanks for the reply! It's not exactly that I want to allow any command to be run as app_user. The command I actually want to run is very long, and complicated and wouldn't mean much in this context, so I simplified my example. The problem is that <i>any command </i>I run will fail, wether or not they already have the permissions to run said command. </div><div><br></div><div>The exact command that I want to run <b>will work</b> if I `sudo su - app_user` and then run the command in the new shell for `app_user`. It <b>wont work</b> if I try to run `sudo su - app_user -c <command>`. So the user has the permissions to run the command. it just wont work with the `-c` option. </div><div><br></div><div>So thats where I'm stuck. From my perspective they should have all the permissions that they need. They have sudo privileges to `sudo su - app_user -c` as well as the specific command that I want to be run.</div><div><br></div><div>Thanks</div><div><br></div><div>Ryan</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 31, 2016 at 4:51 AM, Pavel Březina <span dir="ltr"><<a href="mailto:pbrezina@redhat.com" target="_blank">pbrezina@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 08/30/2016 05:08 PM, Ryan Whalen wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi All,<br>
<br>
Im having an issue getting a command to run properly, and the issue<br>
seems to be with Freeipa sudo permissions. Specifically 'sudo su -<br>
app_user -c "<command>"' prompts for a password when run.<br>
<br>
However if I 'sudo su - app_user' and then run the '<command>' as<br>
app_user, it works fine.<br>
<br>
example:<br>
```<br>
$ ssh ryan@production-server.pp<br>
Last login: Mon Aug 29 21:36:14 2016 from 10.20.3.15<br>
ryan$ sudo su - app_user -c "df"<br>
[sudo] password for ryan:<br>
^C<br>
ryan$ sudo su - app_user<br>
app_user$ df<br>
Filesystem 1K-blocks Used Available Use% Mounted on<br>
/dev/sda3 14845784 6667296 7417708 48% /<br>
tmpfs 1474228 0 1474228 0% /dev/shm<br>
/dev/sda1 487652 81221 380831 18% /boot<br>
10.51.0.34:/srv/nfs/app<br>
287687168 69111040 218576128 25% /var/app<br>
10.51.0.54:/srv/nfs/ipa<br>
16377088 3728640 11809792 24% /home/ipa<br>
ap_user$<br>
```<br>
<br>
I have a sudo rule that allows `/bin/su - app_user` and `/bin/su -<br>
app_user -c` but I cant get the `-c` to work in a single command. I also<br>
tried giving sudo permission to `/bin/bash` in case the `-c` needed it<br>
to create a new shell for some reason, but it didn't work.<br>
<br>
Does anyone have any thoughts on what permissions I might be missing to<br>
allow the user to run `sudo su - app_user -c <command>`?<br>
<br>
Thanks,<br>
Ryan<br>
<br>
<br>
</blockquote>
<br></div></div>
Try to allow /bin/su - app_user -c '*'<br>
<br>
If I understand you correctly, you want to allow user to run any command as app_user. You can do it also by creating a rule that allows to run any command and run it as app_user.<span class="HOEnZb"><font color="#888888"><br>
<br>
-- <br>
Manage your subscription for the Freeipa-users mailing list:<br>
<a href="https://www.redhat.com/mailman/listinfo/freeipa-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman<wbr>/listinfo/freeipa-users</a><br>
Go to <a href="http://freeipa.org" rel="noreferrer" target="_blank">http://freeipa.org</a> for more info on the project<br>
</font></span></blockquote></div><br></div></div>