<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>dwc: Mac OS X vs. Samba, Round 3</title>

<link rel="stylesheet" href="http://grove.ufl.edu/~dwc/style.css" type="text/css" />
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://grove.ufl.edu/~dwc/index.rdf" />

<link rel="start" href="http://grove.ufl.edu/~dwc/" title="Home" />
<link rel="prev" href="http://grove.ufl.edu/~dwc/archives/000469.html" title="Formal Introductions" />

<link rel="next" href="http://grove.ufl.edu/~dwc/archives/000471.html" title="How to Annoy Me" />


<script type="text/javascript" language="javascript">
<!--

function OpenTrackback (c) {
    window.open(c,
                    'trackback',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

var HOST = 'grove.ufl.edu';

// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    setCookie('mtcmtauth', f.author.value, now, '', HOST, '');
    setCookie('mtcmtmail', f.email.value, now, '', HOST, '');
    setCookie('mtcmthome', f.url.value, now, '', HOST, '');
}

function forgetMe (f) {
    deleteCookie('mtcmtmail', '', HOST);
    deleteCookie('mtcmthome', '', HOST);
    deleteCookie('mtcmtauth', '', HOST);
    f.email.value = '';
    f.author.value = '';
    f.url.value = '';
}

//-->
</script>





</head>

<body>

<div id="banner">
<h1><a href="http://grove.ufl.edu/~dwc/" accesskey="1">dwc</a></h1>
<span class="description"></span>
</div>

<div id="container">

<div class="blog">

<div id="menu">
<a href="http://grove.ufl.edu/~dwc/archives/000469.html">&laquo; Formal Introductions</a> |

<a href="http://grove.ufl.edu/~dwc/">Main</a>
| <a href="http://grove.ufl.edu/~dwc/archives/000471.html">How to Annoy Me &raquo;</a>

</div>

</div>


<div class="blog">

<h2 class="date">November 08, 2004</h2>

<div class="blogbody">

<h3 class="title">Mac OS X vs. Samba, Round 3</h3>

<p>I come back to this problem every so often, but never work on it for very long because it's so frustrating. Finally, I've isolated the problem to NTLMv2 authentication in Mac OS X's version of Samba. (<a href="http://grove.ufl.edu/~dwc/archives/000433.html">Round 1</a>, <a href="http://grove.ufl.edu/~dwc/archives/000445.html">Round 2</a>)</p>

<p>After updating to 10.3.6, I decided to try connecting again, since <a href="http://www.apple.com/support/downloads/macosxupdate_10_3_6.html">the notice</a> claimed &quot;improved file sharing for &#8230; PC (SMB/CIFS)&quot;. From the Windows side, everything looked the same: Windows tries passing domain authentication (a few dozen times, according to the logs). After giving up, it presents a password dialog. You enter the username and password of the Mac OS X account, which are rejected.</p>

<p>Maybe I missed it in the logs last time, but this whole process spit out a pretty informative message (at <code>log level = 1</code>) this time around:</p>

<blockquote>
  <p><code>[2004/11/08 09:48:22, 1] auth_ods.c:opendirectory_ntlmv2_auth_user(312)<br />
    &nbsp;&nbsp;User &quot;dwc&quot; failed to authenticate with &quot;dsAuthMethodStandard:dsAuthNodeNTLMv2&quot; (-14091) :(
  </code></p>
</blockquote>

<p>There are server options to disable the weaker LANMAN and NTLM authentication methods, but not the NTLMv2 method (please, someone correct me if I'm wrong). You can force NTLMv2 authentication on the server side by saying:</p>

<blockquote>
  <p><code>lanman auth = no<br />
    ntlm auth = no
  </code></p>
</blockquote>

<p>When I restarted <code>smbd</code> with these options, all clients were denied access, even clients that could connect before, with the same error in the logs. So the Windows clients just happened to expose a problem with NTLMv2 authentication (due to their <code>LMCompatibilityLevel</code>, NTLMv2 is preferred). I either missed this fact because I wasn't reading the logs closely enough, or it wasn't being logged in any useful manner until the 10.3.6 update.</p>

<p>Once again, I'm sort of stuck. At this point, I know the problem lies in the <code>opendirectory_ntlmv2_auth_user</code> method, but I'm not sure I know how to fix it. I'd like to finally close this issue, but I still have some research and testing ahead.</p>

<p>If you're having similar problems, you might want to read <a href="http://www.usenix.org/publications/library/proceedings/lisa-nt2000/leighton.html">a paper</a> by one of the Samba developers from a USENIX conference in 2000. It discusses some of the registry values which control the authentication; if you have access to <code>regedit</code> (I don't), you may be able to solve the problem fairly easily. (The <code>server NTLMv2</code> option referenced in that paper does not work on Mac OS X's version of Samba.)</p>

<p><em>All my world in one grain of sand<br />
  And I've blown it</em></p>

<a name="more"></a>


<span class="posted">Posted by dwc in <a href="http://grove.ufl.edu/~dwc/archives/cat_work.html">Work</a> at <a href="http://grove.ufl.edu/~dwc/archives/000470.html">04:01 PM</a>

<br /></span>

</div>


</div>
</div>
</body>
</html>
