<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 10/16/2012 10:05 AM, Macklin, Jason wrote:
    <blockquote
cite="mid:A3D24235A37CF1419E9568858A6AD93402F56C3F84@RNUMSEM722.nala.roche.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 14 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Arial","sans-serif";
        color:windowtext;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        color:black;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Arial","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif][if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">When
            I become the user in question I see the following in the
            sssd log.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">           
            [ipa_hbac_evaluate_rules] (0x0080): Access granted by HBAC
            rule [test]<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">I
            think this is a sudo problem before anything else.  For a
            user in which sudo works, host_matches = 1 always returns
            when debugging is on.  For a user that does not work
            host_matches always equals 0 (zero). <o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
      </div>
    </blockquote>
    <br>
    Is there any way to see a more detailed debug log from sudo then? It
    should show what it is looking for and what it is getting back from
    the server.<br>
    <br>
    <blockquote
cite="mid:A3D24235A37CF1419E9568858A6AD93402F56C3F84@RNUMSEM722.nala.roche.com"
      type="cite">
      <div class="WordSection1">
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">I
            am open to troubleshooting the ldap configuration as I am
            not convinced that it is referencing the host properly.  I
            enroll the clients using FQDN, but noticed that initially,
            domainname and nisdomainname qould return (none).  Fixing
            these to show the correct domain did not change the behavior
            of the nodes though.<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Thanks
            again!<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D">Jason<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
        <div>
          <div style="border:none;border-top:solid #B5C4DF
            1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">From:</span></b><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif";color:windowtext">
                <a class="moz-txt-link-abbreviated" href="mailto:freeipa-users-bounces@redhat.com">freeipa-users-bounces@redhat.com</a>
                [<a class="moz-txt-link-freetext" href="mailto:freeipa-users-bounces@redhat.com">mailto:freeipa-users-bounces@redhat.com</a>] <b>On Behalf
                  Of </b>Dmitri Pal<br>
                <b>Sent:</b> Monday, October 15, 2012 5:58 PM<br>
                <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:freeipa-users@redhat.com">freeipa-users@redhat.com</a><br>
                <b>Subject:</b> Re: [Freeipa-users] Sudo works for full
                access, but not on a per command or host level.<o:p></o:p></span></p>
          </div>
        </div>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">On 10/15/2012 04:46 PM, Dmitri Pal wrote: <o:p></o:p></p>
        <p class="MsoNormal">On 10/15/2012 04:34 PM, Macklin, Jason
          wrote: <o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Hi,</span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">I
            apologize up front if this is obvious, but I’m having issues
            configuring sudo privileges.  </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">I
            currently have an IPA server running FreeIPA 2.2 with sudo
            configured for our administrators on all hosts.  This works
            fantastic!  As soon as I attempt to configure a more
            specific sudo rule it does not work.  In my troubleshooting,
            I have noticed that from the same host my admin level
            privileges work, but with another user account setup to just
            run one command, it fails.  I have turned on sudo debugging
            and the only thing I can find that looks out of sorts is the
            following:</span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">sudo:
            host_matches=0</span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">As
            soon as I move the user account that is failing into the
            admin group it starts to work. </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
        <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">I
            have attempted every iteration of sudo configuration on the
            server that I can think of.  I have setup HBAC and given
            that a shot as well.  At this point I’m completely stumped
            and would appreciate any help that I can get!</span><o:p></o:p></p>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif""><br>
            What does sudo test return?<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif""><br>
            Yes I meant HBAC. I might confused you and myself so let us
            start over.<br>
            <br>
            First we need to make sure that the authentication happens
            correctly so if HBAC is set to allow you should see in the
            SSSD log that access is granted. That will limit the problem
            to just SUDO. If you have the allow_all HBAC rule and no
            other rules then we can probably skip this step and move on
            to trying to solve the actual SUDO part.<br>
            <br>
            So with SUDO one of the known issues is the long vs short
            hostname. Do you by any chance use a short host name for
            that host?<br>
            If names are FQDN the next step would be to use ldapsearch
            from the client and see what LDAP entries the server would
            return.<br>
            <br>
            <br>
            <o:p></o:p></span></p>
        <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
          <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif""> </span><o:p></o:p></p>
          <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Thank
              you in advance for your assistance,</span><o:p></o:p></p>
          <p class="MsoNormal"><span
style="font-size:10.0pt;font-family:"Arial","sans-serif"">Jason</span><o:p></o:p></p>
          <p class="MsoNormal"><span
              style="font-size:12.0pt;font-family:"Times New
              Roman","serif""><br>
              <br>
              <br>
              <o:p></o:p></span></p>
          <pre>_______________________________________________<o:p></o:p></pre>
          <pre>Freeipa-users mailing list<o:p></o:p></pre>
          <pre><a moz-do-not-send="true" href="mailto:Freeipa-users@redhat.com">Freeipa-users@redhat.com</a><o:p></o:p></pre>
          <pre><a moz-do-not-send="true" href="https://www.redhat.com/mailman/listinfo/freeipa-users">https://www.redhat.com/mailman/listinfo/freeipa-users</a><o:p></o:p></pre>
        </blockquote>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif""><br>
            <br>
            <br>
            <o:p></o:p></span></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Thank you,<o:p></o:p></pre>
        <pre>Dmitri Pal<o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre>Sr. Engineering Manager for IdM portfolio<o:p></o:p></pre>
        <pre>Red Hat Inc.<o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre>-------------------------------<o:p></o:p></pre>
        <pre>Looking to carve out IT costs?<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="http://www.redhat.com/carveoutcosts/">www.redhat.com/carveoutcosts/</a><o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre><o:p> </o:p></pre>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif""><br>
            <br>
            <br>
            <o:p></o:p></span></p>
        <pre>_______________________________________________<o:p></o:p></pre>
        <pre>Freeipa-users mailing list<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="mailto:Freeipa-users@redhat.com">Freeipa-users@redhat.com</a><o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="https://www.redhat.com/mailman/listinfo/freeipa-users">https://www.redhat.com/mailman/listinfo/freeipa-users</a><o:p></o:p></pre>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:"Times New
            Roman","serif""><br>
            <br>
            <br>
            <o:p></o:p></span></p>
        <pre>-- <o:p></o:p></pre>
        <pre>Thank you,<o:p></o:p></pre>
        <pre>Dmitri Pal<o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre>Sr. Engineering Manager for IdM portfolio<o:p></o:p></pre>
        <pre>Red Hat Inc.<o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre>-------------------------------<o:p></o:p></pre>
        <pre>Looking to carve out IT costs?<o:p></o:p></pre>
        <pre><a moz-do-not-send="true" href="http://www.redhat.com/carveoutcosts/">www.redhat.com/carveoutcosts/</a><o:p></o:p></pre>
        <pre><o:p> </o:p></pre>
        <pre><o:p> </o:p></pre>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Freeipa-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeipa-users@redhat.com">Freeipa-users@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/freeipa-users">https://www.redhat.com/mailman/listinfo/freeipa-users</a></pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Thank you,
Dmitri Pal

Sr. Engineering Manager for IdM portfolio
Red Hat Inc.


-------------------------------
Looking to carve out IT costs?
<a class="moz-txt-link-abbreviated" href="http://www.redhat.com/carveoutcosts/">www.redhat.com/carveoutcosts/</a>


</pre>
  </body>
</html>