Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plain text passwords are disabled NetBios remote connection

I'm trying connect remotely to windows machine and fetch files from this machine. this is my code,

 path = path.replace(":","");
        path = path.replace("\\","/");
        String smbpath="smb://"+host+":445/"+path; //c/alon2.txt";

        NtlmPasswordAuthentication auth = new NtlmPasswordAuthentication(user+":"+password);
        SmbFile smbFile = new SmbFile(smbpath,auth);

        SmbFileInputStream input = new SmbFileInputStream(smbFile);
        Files.copy(input, destPath.toPath());
        System.out.println("completed fetching file");
        return destPath;

and I got this exception, "Plain text passwords are disabled", i tried to put jcifs.Config.setProperty("jcifs.smb.client.disablePlainTextPasswords","true"); and it doesnt work, and i dont want to disable the smb 3rd party in the server. Any idea?

java.lang.RuntimeException: Plain text passwords are disabled at jcifs.smb.SmbComTreeConnectAndX.writeParameterWordsWireFormat(SmbComTreeConnectAndX.java:129) at jcifs.smb.AndXServerMessageBlock.writeAndXWireFormat(AndXServerMessageBlock.java:94) at jcifs.smb.AndXServerMessageBlock.writeAndXWireFormat(AndXServerMessageBlock.java:166) at jcifs.smb.AndXServerMessageBlock.encode(AndXServerMessageBlock.java:65) at jcifs.smb.SmbTransport.doSend(SmbTransport.java:439) at jcifs.util.transport.Transport.sendrecv(Transport.java:67) at jcifs.smb.SmbTransport.send(SmbTransport.java:655) at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:316) at jcifs.smb.SmbSession.send(SmbSession.java:218) at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176) at jcifs.smb.SmbSession.logon(SmbSession.java:147) at jcifs.smb.SmbSession.logon(SmbSession.java:140) at com.hp.autopass.usagehub.service.util.osutils.NetBiosConnection.authenticate(NetBiosConnection.java:47) at com.hp.autopass.usagehub.service.NetBiosConnectionTest.authenticateTest(NetBiosConnectionTest.java:34) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)

like image 251
user2303962 Avatar asked Mar 23 '15 12:03

user2303962


1 Answers

You should use jcifs.Config.setProperty("jcifs.smb.client.disablePlainTextPasswords","false"); to enable plain text passwords. In your code you set this flag as true.

like image 86
Nirmal Raghavan Avatar answered Sep 29 '22 21:09

Nirmal Raghavan