Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] JGit Doesn't check StrictHostKeyChecking Parameter Value in the .ssh Folder?

Thanks for the suggestion, will get on with it asap. Meanwhile this is the exact stacktrace that I have been getting. I'm putting it down here since there might be a chance that someone has encountered the same and solved it, in case will save some valuable time for me :)


org.eclipse.jgit.api.errors.TransportException: git@xxxxxxxxxxxxxxxx:test.org/test_repo.git: Auth fail
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:137)
    at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:178)
    at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:125)
    at GitTest.cloneRepo(GitTest.java:92)
    at GitTest.main(GitTest.java:206)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.eclipse.jgit.errors.TransportException: git@xxxxxxxxxxxxxxxx:test.org/test_repo.git: Auth fail
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:142)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
    at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:136)
    at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:122)
    at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1104)
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:128)
    ... 9 more
Caused by: com.jcraft.jsch.JSchException: Auth fail
    at com.jcraft.jsch.Session.connect(Session.java:452)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
    ... 16 more

If anyone has experienced the same error and has managed to resolve it, please let me know.


On Fri, Nov 30, 2012 at 11:11 PM, Tomasz Zarna <tzarna@xxxxxxxxx> wrote:
> org.eclipse.jgit.api.errors.TransportException: git@<path_to_git_repo_on_remote_server>.git: Auth fail
> Any guidance/explanation on what is the issue here and how to resolve it is highly appreciated!

See http://sourceforge.net/tracker/?func=detail&aid=1047646&group_id=64920&atid=509125,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=374204,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349034. I'm afraid the
best way to figure out what's happening under the hood is to grab JSch
source and debug it :/

Good luck!

On Fri, Nov 30, 2012 at 6:13 PM, Isuru Haththotuwa <isurulucky@xxxxxxxxx> wrote:
> Thanks. So it does read the .ssh information, and we can use the configure
> (host, session) to override the the default session information and provide
> custom information to the session. So I used the following:
>
>         JschConfigSessionFactory jschConfigSessionFactory = new
> JschConfigSessionFactory() {
>
>             @Override
>             protected void configure(OpenSshConfig.Host host, Session
> session) {
>
>                 session.setConfig("StrictHostKeyChecking", "no");
>             }
>         };
>
>         SshSessionFactory.setInstance(jschConfigSessionFactory);
>
> Now, a new exception is thrown, not the previous UnknownHostKey exceptoin:
>
> org.eclipse.jgit.api.errors.TransportException:
> git@<path_to_git_repo_on_remote_server>.git: Auth fail
>
> Any guidance/explanation on what is the issue here and how to resolve it is
> highly appreciated!
>
>
>
>
> On Fri, Nov 30, 2012 at 5:55 PM, Tomasz Zarna <tzarna@xxxxxxxxx> wrote:
>>
>> > How does JGit read data from the .ssh folder?
>>
>> Have a look at
>> https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java
>>
>> Cheers,
>> Tomasz
>>
>> On Fri, Nov 30, 2012 at 12:53 PM, Isuru Haththotuwa
>> <isurulucky@xxxxxxxxx> wrote:
>> > Hi all,
>> >
>> > I have specified StrictHostKeyChecking parameter value as 'no' in the
>> > .ssh/config file, in Ubuntu. However, when I try to access a repository
>> > I
>> > still get the error saying UnknownHostException. Is is possible to set
>> > this
>> > programatically with JGit?
>> >
>> > I specified not to check host key since I originally couldn't access a
>> > remote repository with the repository host's public key in my
>> > .ssh/known_hosts file. But, I could do this with a git hub repo. (added
>> > my
>> > public key to github repo and added github as a known host in my local
>> > machine). When I do the same with a different server, I get this error,
>> > UnknownHostException. How does JGit read data from the .ssh folder? Is
>> > there
>> > a possibility of JGit persisting such data so that it is using the same
>> > key
>> > even when the remote server is different?
>> >
>> > --
>> > Thanks and Regards,
>> > Isuru
>> >
>> >
>> > _______________________________________________
>> > jgit-dev mailing list
>> > jgit-dev@xxxxxxxxxxx
>> > https://dev.eclipse.org/mailman/listinfo/jgit-dev
>> >
>
>
>
>
> --
> Thanks and Regards,
> Isuru
>



--
Thanks and Regards,
Isuru


Back to the top