<p dir="ltr">Thank you Petr for your answer.  I'm trying to do the job with least changes in client which was a operating machine now joined to Free IPA domain.  I just want to make sure if using chmod,  chown or setfacl are the only available solutions or not? <br>
</p>
<div class="gmail_quote">On Jun 28, 2016 12:30 PM, "Petr Spacek" <<a href="mailto:pspacek@redhat.com">pspacek@redhat.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 28.6.2016 09:08, Mitra Dehghan wrote:<br>
> Hello,<br>
><br>
> I want to know how can I give directory permissions on a client to a domain<br>
> user in FreeIPA.<br>
><br>
><br>
> I'm using "runasuser" feature in sudo policy to give my domain users<br>
> permission to run local services on client.<br>
><br>
> Here is an example:<br>
> I have a service on my client called "*abc*" located at "/home/abc/" and<br>
> locally run by local user called "*abc*"<br>
><br>
> I have used runasuser feature in sudo policy rules to let domain users<br>
> (say: *usr@mydomain.dc*) run the service. *usr* can run scripts, read and<br>
> edit files and stop/start services, using *abc*'s permissions and without<br>
> any problem.<br>
><br>
> But the problem I have faced is, when I want "*usr*" to traverse<br>
> subdirectories under "*/home/abc/*" it doesn't work.<br>
> I have defined sudocmd for cd command and added it as allow-command to<br>
> appropriate sudorule. my sudocmd definitions are like this:<br>
><br>
><br>
> *ipa sudocmd-add --desc="ttttttt" 'cd /home/abc/n/'*<br>
><br>
> *ipa sudocmd-add --desc="ttttttt" 'cd /home/abc/m/'*<br>
> *ipa sudocmd-add --desc="ttttttt" 'cd /home/abc/n/q/'*<br>
><br>
> While *usr* can run the *cd* command without error, it doesn't work and<br>
> *pwd* still shows* /home/usr* as current directory.<br>
> what *usr* runs is:<br>
> *$ sudo -u abc cd /home/abc/m*/<br>
<br>
Most importantly you need to add appropriate permission for user abc to the<br>
/home/abc directory (and its contents if necessary).<br>
<br>
You can use either chown+chmod or setfacl commands, depending on the use-case.<br>
<br>
When this is one, add SUDO rule allowing user usr to run a program in<br>
question. You do not need to bother with SUDO rules for "cd" because this will<br>
be solved at filesystem level.<br>
<br>
--<br>
Petr^2 Spacek<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/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>
</blockquote></div>