Hi Sachith

Got a chance to run your code. You need to set useSubjectCredsOnly to false
to allow the krb5 provider to obtain credentials from a source other than
the current Subject unless you want to do all auth work yourself. With that
set to false it works.

Borislav

On Friday, February 21, 2014, Sachith Withana <swsach...@gmail.com> wrote:

> Thanks a lot for the quick replies. I didn't get to check Borlslav's
> answer.
> Here's the error output Atsuhiko, Other authentication methods passes. And
> I can use the kerberos ticket to ssh to the host machine using the terminal.
>
> INFO: SSH_MSG_NEWKEYS sent
> INFO: SSH_MSG_NEWKEYS received
> INFO: SSH_MSG_SERVICE_REQUEST sent
> INFO: SSH_MSG_SERVICE_ACCEPT received
> INFO: Authentications that can continue: gssapi-with-mic
> INFO: Next authentication method: gssapi-with-mic
> INFO: Disconnecting from ********* port 22
> com.jcraft.jsch.JSchException: Auth fail
> at com.jcraft.jsch.Session.connect(Session.java:512)
>  at
> lk.sachith.kerberos.JSCHKerberosConnector.main(JSCHKerberosConnector.java:42)
> at JSCHTest.testKerberos(JSCHTest.java:10)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
>  at
> org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
> at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
>  at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
> at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
>  at
> org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
> at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
>  at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
> at org.testng.TestRunner.privateRun(TestRunner.java:757)
>  at org.testng.TestRunner.run(TestRunner.java:608)
> at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
>  at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
> at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
>  at org.testng.SuiteRunner.run(SuiteRunner.java:240)
> at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
>  at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
> at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
>  at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
> at org.testng.TestNG.run(TestNG.java:999)
> at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
>  at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:203)
> at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:174)
>  at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:125)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  at java.lang.reflect.Method.invoke(Method.java:606)
> at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
> RemoteTestNG finishing: 635 ms
>
>
>
> On Fri, Feb 21, 2014 at 9:02 PM, Atsuhiko Yamanaka 
> <y...@jcraft.com<javascript:_e(%7B%7D,'cvml','y...@jcraft.com');>
> > wrote:
>
>> Hi,
>>
>>    +-From: Sachith Withana 
>> <swsach...@gmail.com<javascript:_e(%7B%7D,'cvml','swsach...@gmail.com');>>
>> --
>>    |_Date: Thu, 20 Feb 2014 11:43:14 -0500 ________
>>    |
>>    |I need to get kerberos working through Java. ( SSH using the kerberos
>>    |ticket)
>>    |Currently it works with the terminal ( ssh host command) using the
>>    |gssapi-with-mic
>>    |But I'm having trouble getting it working with the JSCH library in
>> Java.
>>    |Here's the code snippet I tried. ( pastebin:
>> http://pastebin.com/sX8pUQSq)
>>    |JSch jsch = new JSch();
>>    |        jsch.setLogger(new MyLogger());
>>
>> There may be a hint in the outputs from MyLogger().
>> Whould you show it?
>>
>>
>> Sincerely,
>> --
>> Atsuhiko Yamanaka
>> JCraft,Inc.
>> 1-14-20 HONCHO AOBA-KU,
>> SENDAI, MIYAGI 980-0014 Japan.
>> Tel +81-22-723-2150
>> Skype callto://jcraft/
>> Twitter: http://twitter.com/ymnk
>> Facebook: http://facebook.com/aymnk
>>
>
>
>
> --
> Thanks,
> Sachith Withana
>
>
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to