title: smbclient NT_STATUS_ACCESS_DENIED
body: <p>About once every 10 years I need to wrestle with SAMBA as I migrate to new hosts, and then I repress the traumatic memory until I have to relearn it all the next time :S  Hence this newbyish question.</p>
  
  <p>I have a Ubuntu VM with a couple of shares - one ("Public") is unsecured, the other ("Public2") is secured, with the intention that it should be accessed only by an authenticated user account defined on the Ubuntu box.  Both shares appear in Windows Explorer on both XP and Win8.1.  However, I can't for the life of me work out how to log into the secure Public2 share.</p>
  
  <p>Leaving Windows clients out of it, I've tried simply looping back to the box using smbclient, which produces the following output, indicating it just can't authenticate:</p>
  
  <pre><code>michael@ubuntu:~$ smbclient //ubuntu/Public2 --user=michael%mypasswd
  Domain=[WORKGROUP] OS=[Unix] Server=[Samba 4.1.6-Ubuntu]
  tree connect failed: NT_STATUS_ACCESS_DENIED
  </code></pre>
  
  <p>Meanwhile the unsecured share <em>is</em> accessible.
  What (probably incredibly obvious) thing have I missed?  Am I not specifying the username correctly?</p>
  
  <pre><code>/var/lib/samba/usershares/public (unsecure, works) contains:
  
  
  #VERSION 2
  path=/home/michael/Public
  comment=
  usershare_acl=S-1-1-0:F
  guest_ok=y
  sharename=Public
  </code></pre>
  
  <p>/var/lib/samba/usershares/public2 (which I can't access) contains:</p>
  
  <pre><code>#VERSION 2
  path=/home/michael/Public2
  comment=
  usershare_acl=S-1-1-0:F
  guest_ok=n
  sharename=Public2
  </code></pre>