Fix issue with servers that have GSSAPI authentication enabled.

Force SSH client to only try publickey and password authentication modes (in that order).
This commit is contained in:
lsowen
2015-06-08 21:47:27 -04:00
parent 84589ab869
commit 8a22e6efe3

View File

@@ -38,6 +38,7 @@ public class SshConfigSessionFactory extends GitConfigSessionFactory {
@Override
protected void configure(OpenSshConfig.Host hc, Session session) {
session.setConfig("StrictHostKeyChecking", "no");
session.setConfig("PreferredAuthentications", "publickey,password");
CredentialsProvider provider = new CredentialsProvider() {
@Override
@@ -67,4 +68,4 @@ public class SshConfigSessionFactory extends GitConfigSessionFactory {
UserInfo userInfo = new CredentialsProviderUserInfo(session, provider);
session.setUserInfo(userInfo);
}
}
}