int128 / int128/gradle-ssh-plugin

Connect using SSH2

Open
#304 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Groovy
Stars
325
Forks
59
Avg merge
5h 29m
Merged PRs (30d)
6

Description

I am unable to connect to a remote machine using gradle-ssh-plugin, but commandline ssh works reliably. I think it has something to do with the ssh protocol that is used:

commandline ssh:

debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA [...]
debug1: Host '10.2.37.88' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:17
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentication succeeded (none).

gradle-ssh-plugin log:

14:59:22.055 [QUIET] [system.out] gradle-ssh-plugin-2.9.0 (groovy-ssh-2.9.0, jsch-0.1.53, groovy-2.4.10, java-1.8.0_65)
14:59:22.094 [DEBUG] [org.hidetake.groovy.ssh.core.Service] Using default settings: {fileTransfer=sftp, jschLog=false, retryWaitSec=0, timeoutSec=0, pty=false, authentications=[publickey, keyboard-interactive, password], agentForwarding=false, keepAliveSec=60, sudoPath=sudo, dryRun=false, encoding=UTF-8, retryCount=0, logging=slf4j, knownHosts=/home/user/.ssh/known_hosts, ignoreError=false, agent=false}
14:59:22.096 [DEBUG] [org.hidetake.groovy.ssh.core.Service] Using global settings: {}
14:59:22.101 [DEBUG] [org.hidetake.groovy.ssh.core.Service] Using per-service settings: {}
14:59:22.115 [DEBUG] [org.hidetake.groovy.ssh.session.SessionTask] Using per-remote settings: {fileTransfer=scp, jschLog=true, user=root}
14:59:22.128 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] Enabled JSch logging on Thread[Daemon worker Thread 16,5,main]
14:59:22.171 [DEBUG] [org.hidetake.groovy.ssh.connection.ConnectionManager] Connecting to Remote1[10.2.37.88:22] with {keepAliveSec=60, retryCount=0, retryWaitSec=0, knownHosts=/home/user/.ssh/known_hosts, timeoutSec=0, agent=false, authentications=[publickey, keyboard-interactive, password], user=root}
14:59:22.220 [DEBUG] [org.hidetake.groovy.ssh.connection.HostAuthentication$Helper] Using known-hosts file for Remote1[10.2.37.88:22]: /home/user/.ssh/known_hosts
14:59:22.239 [DEBUG] [org.hidetake.groovy.ssh.connection.HostAuthentication$Helper] Using key exhange algorithm for Remote1[10.2.37.88:22]: ecdsa-sha2-nistp521
14:59:22.243 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] Connecting to 10.2.37.88 port 22
14:59:22.243 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] Connection established
14:59:22.262 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] Remote version string: SSH-2.0-OpenSSH_7.3
14:59:22.262 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] Local version string: SSH-2.0-JSCH-0.1.53
14:59:22.263 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
14:59:22.274 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] aes256-ctr is not available.
14:59:22.274 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] aes192-ctr is not available.
14:59:22.274 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] aes256-cbc is not available.
14:59:22.274 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] aes192-cbc is not available.
14:59:22.274 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] CheckKexes: diffie-hellman-group14-sha1,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521
14:59:22.320 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] CheckSignatures: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] SSH_MSG_KEXINIT sent
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] SSH_MSG_KEXINIT received
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp521,ssh-ed25519
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr
14:59:22.322 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: none
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: none
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: 
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server: 
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: ecdsa-sha2-nistp521
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: hmac-md5,hmac-sha1,hmac-sha2-256,hmac-sha1-96,hmac-md5-96
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: none
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: none
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: 
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client: 
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: server->client aes128-ctr hmac-sha1 none
14:59:22.323 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] kex: client->server aes128-ctr hmac-sha1 none
14:59:22.324 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] SSH_MSG_KEX_ECDH_INIT sent
14:59:22.325 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] expecting SSH_MSG_KEX_ECDH_REPLY
14:59:22.347 [DEBUG] [org.hidetake.groovy.ssh.connection.JSchLogger] [jsch] Disconnecting from 10.2.37.88 port 22
14:59:22.355 [DEBUG] [org.hidetake.groovy.ssh.connection.ConnectionManager] Closing connections: []

The only seemingly significant difference is in the protocol:

native ssh:         SSH2_MSG_KEX_ECDH_INIT
gradle-ssh-plugin:  SSH_MSG_KEX_ECDH_INIT

I have not found a way to configure if the plugin uses SSH or SSH2. Is this possible? I have searched the documentation and sources of the plugin and gradle-ssh, but could not find a way to configure it.

Environment info

gradle-ssh-plugin-2.9.0 (groovy-ssh-2.9.0, jsch-0.1.53, groovy-2.4.10, java-1.8.0_65)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the connection against the reported OpenSSH 7.3 environment with JSch 0.1.53, then inspect the gradle-ssh-plugin and gradle-ssh connection sources referenced in the report. Compare the successful command-line negotiation with the plugin logs; done means identifying the compatibility issue and confirming a reliable SSH connection.

Written by the indexing model from the issue text.

Assessment

Tech stack
groovy
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.