Skip to content

Improve ssh host-key verification and timeout handling. - #611

Merged
frankgiordano merged 1 commit into
mainfrom
aug7
Aug 9, 2026
Merged

Improve ssh host-key verification and timeout handling.#611
frankgiordano merged 1 commit into
mainfrom
aug7

Conversation

@frankgiordano

Copy link
Copy Markdown
Collaborator

PR updates for UssCmd.java:

  • Enabled strict SSH host-key verification by default using the user's default known_hosts file.
  • Added support for the existing zowe.sdk.allow.insecure.connection system property as an explicit opt-out of host-key verification.
  • Added a warning log when insecure SSH host-key verification is enabled.
  • Only loads the known_hosts file when secure host-key verification is enabled.
  • Added timeout handling to the SSH session connection.
  • Added timeout handling to the SSH channel connection.
  • Added a timeout for remote USS command execution to protect against network hangs or stuck processes.
  • Validated that the command timeout is greater than zero.
  • Used System.nanoTime() for reliable elapsed-time measurement and converted the configured timeout from milliseconds to nanoseconds.
  • Updated Javadocs to document SSH session, channel, and command execution timeout behavior.
  • Ensured SSH sessions and channels are properly disconnected through AutoCloseable wrappers.
  • Security
  • SSH host keys are now verified against the user's known_hosts file by default. Unknown or changed host keys are rejected unless the user explicitly enables the existing insecure connection property.
  • The insecure option logs a warning and disables host-key verification using StrictHostKeyChecking=no.

@frankgiordano frankgiordano self-assigned this Aug 9, 2026
@frankgiordano frankgiordano added enhancement New feature or request Improvement labels Aug 9, 2026
@frankgiordano
frankgiordano merged commit f8bf356 into main Aug 9, 2026
4 checks passed
@frankgiordano
frankgiordano deleted the aug7 branch August 9, 2026 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant