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. 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


Back to the top