Skip to content

[whpg19-port] Replace Ganymed SSH with sshj in the JSystem automation harness (#95) - #102

Open
Bonartze wants to merge 1 commit into
feat/whpg19-portfrom
whpg19-port/sshj-l2
Open

Bonartze wants to merge 1 commit into
feat/whpg19-portfrom
whpg19-port/sshj-l2

Conversation

@Bonartze

@Bonartze Bonartze commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Cherry-pick of #95 (0f5be4e1d, merged to main on 2026-10-19) onto feat/whpg19-port, applied with git cherry-pick -x; no conflicts.

Why

EnterpriseDB/whpg-extensions-packaging#151 drops the el8-only L2 gate now that the JSystem harness connects with sshj, so the WHPG19 lane (el9-only, packages this branch) starts running L2 without the Ganymed-era legacy sshd block. This branch's automation/pom.xml still pulls Ganymed, which cannot negotiate with el9's OpenSSH, so L2 on 19 would fail until the port has #95. Until this merges, packaging#151 skips L2 on a source tree whose automation pom has no sshj dependency, so the 19 lane stays green either way; once this is in, that skip lifts by itself.

What changes

Same four files as #95: automation/pom.xml (sshj 0.41.2, Ganymed excluded from the jsystem cli artifact, slf4j-api pinned, BC jdk15on excluded), SshRsa.java rewritten on sshj, the one-line PxfCliConnectionImpl change, and the automation README's SSH section.

The automation harness opened every system-object shell through
systemobject.terminal.SSH / our SshRsa subclass, both backed by Ganymed
SSH2 (ch.ethz.ssh2), a 2006-era client whose handshake crypto stops at
diffie-hellman-group1/group14-sha1 KEX and CBC ciphers. OpenSSH 9.x builds
drop those algorithms at compile time, and sshd's "+algo" modifier can only
re-enable what was built in, so on el9 Ganymed shares no usable KEX or
cipher with sshd and the L2 suite cannot connect to localhost:22. That is
why the packaging smoke gates L2 (and its singlecluster umbrella) to el8.

SshRsa now extends JSystem's Terminal directly and drives the shell with
sshj 0.41.2 (Java 8 compatible): connect, authenticate, allocate a "dumb"
PTY (same as Ganymed's requestDumbPTY(), so terminal-aware commands do not
colour their output), start the shell, hand the channel streams to the
Terminal. Password (password + keyboard-interactive) is tried when the SUT
gives one, otherwise the SUT's privateKey file; sshj reads OpenSSH-format,
PEM and PuTTY keys, so the OpenSSH-to-PEM conversion Ganymed needed goes
away too. Host keys are not verified, the trust model Ganymed had.
PxfCliConnectionImpl uses SshRsa for both the ssh and ssh-rsa protocols, so
nothing in the tree references JSystem's Ganymed-backed SSH any more.

pom: ganymed-ssh2 is dropped as a direct dependency and excluded from
org.jsystemtest.systemobjects:cli (its only remaining path); sshj 0.41.2
is added. Two side effects of sshj's own dependencies are pinned back:
slf4j-api stays on 1.7.36 (sshj declares 2.0.17, which would ignore the
only binding on the classpath, hadoop-common's slf4j-reload4j 1.7.36, and
silence every Hadoop/HBase client log line), and the Bouncy Castle 1.68
jdk15on jars that hive-shims pulls through yarn web-proxy are excluded so
the classpath carries a single BC (sshj's jdk18on 1.84) rather than two
copies of the same classes.

automation/README.md: the "SSH Setup" section no longer tells people to
append legacy KexAlgorithms/HostKeyAlgorithms to sshd_config or to make a
PEM-format RSA key; any unencrypted OpenSSH key works.

Verified locally (Java 8, the module compiles with `mvn compile`;
`git grep ch.ethz.ssh2|ganymed automation/` only hits the exclusion) by
driving SshRsa the way PxfCliConnectionImpl does against two sshd
containers: Rocky Linux 9 (OpenSSH 8.7p1) and Fedora 42 (OpenSSH 9.9p1,
the algorithm set el9 is moving to), each with an OpenSSH-format RSA key,
an ed25519 key and a password; the shell starts with `env PS1='#' bash
--norc`, the prompt matches and the command output comes back through the
Terminal. CliConnectionImpl, which still references JSystem's SSH class,
links fine with ganymed-ssh2 off the classpath.

Companion change: EnterpriseDB/whpg-extensions-packaging drops the
IS_PXF_EL8 gate so L2 runs on el9.

(cherry picked from commit 0f5be4e)
@Bonartze
Bonartze requested review from a team and 24nishant October 19, 2026 07:54
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

Successfully merging this pull request may close these issues.

1 participant