Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows user : com.jcraft.jsch.AgentProxyException: SSH_AUTH_SOCK is not defined. #329

Open
deguich opened this issue Jun 2, 2023 · 1 comment

Comments

@deguich
Copy link

deguich commented Jun 2, 2023

Environment info

On windows 11

Steps to reproduce

Working gradle plugin version :

plugins {
    ...
    id "org.hidetake.ssh" version "2.10.1"
}

Broken version :

plugins {
    ...
    id "org.hidetake.ssh" version "2.11.2"
}

Error :

* What went wrong:
Execution failed for task ':deployApp'.
> com.jcraft.jsch.AgentProxyException: SSH_AUTH_SOCK is not defined.

This is the same task code used for twice version :

remotes {
  deployServer {
    host = deployServerHost
    knownHosts = allowAnyHosts
    user = deployServerUser
    agent = true
    identity = file(deployServerOpenSSHKey)
  }
}

task deployApp {
  group 'deploy'
  description 'Copy to server.'
  dependsOn copyAllDependencies
  doLast {
    ssh.run {
      session(remotes.deployServer) {
        put from: fileTree(dir: 'allLibs', include: ['*.jar']), into: '/tmp/test'
      }
    }
  }
}

Is there a solution to force using PageantConnector ?
mwiede/jsch#65 (comment)

@deguich
Copy link
Author

deguich commented Jun 2, 2023

Hi

If I well understand this comment mwiede/jsch#65 (comment)
They said PageantConnector class have not been tested but this class is always needed to make a pagent connection.

They also spoke about jsch-agent-proxy having a solution to optimize SSHAgentConnector. It fallback ssh-agent support to junix socket or usocket ... but it never return a PagentConnector.

They also mentioned that jsch-agent-proxy offers a solution to optimize SSHAgentConnector. It use junix socket and can fall back to usocket, but it does not fall back to PagentConnector.

jsch-agent-proxy lib used a com.jcraft.jsch.agentproxy.ConnectorFactory to retrieve automatically ssh-agent or pagent connector.

I think it is not the case for org.hidetake.groovy.ssh.connection.UserAuthentication, it use only SSHAgentConnector :

if (settings.agent) {
	// Use agent authentication using https://github.com/mwiede/jsch/issues/65#issuecomment-913051572
	IdentityRepository irepo = new AgentIdentityRepository(new SSHAgentConnector())
        jsch.identityRepository = irepo
        log.debug("Using SSH agent authentication for $remote")
}

Do you think it could be the cause of my issue ?
Thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant