[jcifs] jcifs.smb.SmbAuthException: Logon failure (only with Samba shares)

Chase Simms Csimm at pubpress.com
Wed May 7 19:00:15 GMT 2008

I am able to connect to Windows file shares with JCIFS, but cannot
connect to any of our linux/unix hosts.  I am able to browse the Samba
shares from a windows PC and mount from linux hosts.  I've used the URI
with and without the username/password.  I'm running the JCIFS tests
from my PC which is able to browse any of Samba shares.  

Here's a snippet of test code:
    SmbFile from = new
    SmbFile to = new
    from.copyTo( to );

jcifs.smb.client.domain = pubpress.com
jcifs.smb.client.username = username
jcifs.smb.client.password = password
jcifs.resolveOrder = WINS,DNS
jcifs.netbios.wins =,
jcifs.smb.client.signingPreferred = true

jcifs.smb.SmbAuthException: Logon failure: unknown user name or bad
	at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:289)
	at jcifs.smb.SmbSession.send(SmbSession.java:233)
	at jcifs.smb.SmbTree.treeConnect(SmbTree.java:154)
	at jcifs.smb.SmbFile.doConnect(SmbFile.java:816)
	at jcifs.smb.SmbFile.connect(SmbFile.java:854)
	at jcifs.smb.SmbFile.connect0(SmbFile.java:793)
	at jcifs.smb.SmbFile.copyTo(SmbFile.java:2249)
	at com.pubpress.utils.FileCopy.main(FileCopy.java:17)

parts of smb.conf I thought were relevant:
# workgroup = NT-Domain-Name or Workgroup-Name
   workgroup = PRESS

password server = DomainController5

   comment = Test_Customer
   path = /home/Test_Customer
   public = yes
   writable = no
   printable = no

security = server (on the linux host)    security = share (on the HP-UX

I have several Samba error logs with names like jcifs20_157_**.log. 
They all have the same errors.
more jcifs20_157_bc.log
[2008/05/07 12:22:04, 0] lib/util_sock.c:read_data(436)
  read_data: read failure for 4. Error = Connection reset by peer
[2008/05/07 12:22:04, 0] lib/util_sock.c:read_data(436)
  read_data: read failure for 4. Error = Connection reset by peer

Thank you for any help.  Please let me know if there is any information
I can add.


The information in this email is intended for the sole use of the
addressees and may be confidential and subject to protection under the
law. If you are not the intended recipient, you are hereby notified that
any distribution or copying of this email is strictly prohibited. If you
have received this message in error, please reply and delete your copy.

More information about the jcifs mailing list