[jcifs] SmbSession.logon() trouble

Michael B Allen mba2000 at ioplex.com
Fri May 28 20:31:56 GMT 2004


Sebastian Rehbach said:
> As a domain controller we are using SuSE Linux Professional 9 with Samba
> 2.2.8a-SuSE (which is required, 'cause we don't have a Windows NT / 2000
> domain controller but there will be one in our productive environment)
>
> The java class we are using to test and to demonstrate the problem is
> attached ...

I just wrote something just like this and it worked fine against samba
2.2.7 on RH 7.3.

[miallen at quark jcifs]$ cat Logon.java
import jcifs.*;
import jcifs.smb.*;

public class Logon {

    public static void main( String argv[] ) throws Exception {
                NtlmPasswordAuthentication auth = new
NtlmPasswordAuthentication( argv[1], argv[2], argv[3] );

                SmbSession.logon( UniAddress.getByName( argv[0] ), auth );
    }
}
[miallen at quark jcifs]$ java Logon nano dom foo bar
Exception in thread "main" jcifs.smb.SmbAuthException: Logon failure:
unknown user name or bad password.
        at jcifs.smb.SmbTransport.send(SmbTransport.java:655)
        at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:178)
        at jcifs.smb.SmbSession.send(SmbSession.java:138)
        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:134)
        at jcifs.smb.SmbSession.logon(SmbSession.java:75)
        at Logon.main(Logon.java:9)

Does this program fail for you?

Is there some setting on samba that causes failed logons to default to
GUEST or some such? Try giving a regular Windows workstation for the dc
parmeter.

Mike


More information about the jcifs mailing list