private Session initSessionSSHConfig()

in deploy-runner-agent/src/main/java/jetbrains/buildServer/deployer/agent/ssh/SSHSessionProvider.java [179:190]


  private Session initSessionSSHConfig(String username, JSch jsch, File config) throws JSchException {
    final String configPath = config.getAbsolutePath();
    try {
      final OpenSSHConfig sshConfig = OpenSSHConfig.parseFile(configPath);
      jsch.setConfigRepository(sshConfig);
      final Session session = jsch.getSession(username, myHost, myPort);
      session.setConfig("PreferredAuthentications", "publickey");
      return session;
    } catch (IOException e) {
      throw new JSchException("Error parsing ssh config file [" + configPath + "]", e);
    }
  }