Hi Borislav,
It works now. It might had something to do with the ticket I guess. I
changed nothing today and ran it. It gave the desired output.
Thanks a lot for your continuous help!!
On Mon, Feb 24, 2014 at 4:42 PM, Borislav Stoichkov <
jsch-u...@meanstream.org> wrote:
> Works with 1.6u13 and 1.7u51. Do you have a valid ticket before execution?
> If you want to obtain a ticket as part of the process and don't have a
> valid TGT to begin with you will need to set doNotPrompt to false. It
> doesn't look like you have valid ticket when you run.
>
> Borislav
>
>
> On Mon, Feb 24, 2014 at 2:34 PM, Sachith Withana <swsach...@gmail.com>wrote:
>
>> Thanks a lot again! ..
>>
>> Im glad it worked :) Can you please let me know the version of JDK you
>> used? Because I'm running into an issue,
>>
>> Debug is true storeKey false useTicketCache true useKeyTab false
>> doNotPrompt true ticketCache is /tmp/krb5cc_501_fDBmk28829 isInitiator true
>> KeyTab is null refreshKrb5Config is false principal is null tryFirstPass is
>> false useFirstPass is false storePass is false clearPass is false
>>
>> Acquire TGT from Cache
>>
>> Principal is null
>>
>> null credentials from Ticket Cache
>>
>> [Krb5LoginModule] authentication failed
>>
>> Unable to obtain Princpal Name for authentication
>>
>> Authentication attempt failedjavax.security.auth.login.LoginException:
>> Unable to obtain Princpal Name for authentication
>>
>>
>>
>>
>>
>> On Mon, Feb 24, 2014 at 2:06 PM, Borislav Stoichkov <
>> jsch-u...@meanstream.org> wrote:
>>
>>> 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>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> +-From: Sachith Withana <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
>>>>
>>>>
>>
>>
>> --
>> Thanks,
>> Sachith Withana
>>
>>
>
--
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