Skip to content

Expose the configured IdentityAgent and IdentitiesOnly options - #15

Merged
alexey-milovidov merged 2 commits into
ClickHouse/libssh-0.12.0from
continue-pr-115072-identity-agent-option
Aug 23, 2026
Merged

Expose the configured IdentityAgent and IdentitiesOnly options#15
alexey-milovidov merged 2 commits into
ClickHouse/libssh-0.12.0from
continue-pr-115072-identity-agent-option

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Aug 19, 2026

Copy link
Copy Markdown
Member

Expose SSH_OPTIONS_IDENTITY_AGENT and SSH_OPTIONS_IDENTITIES_ONLY through ssh_options_get, so that consumers can use the values resolved by libssh's full SSH configuration parser instead of parsing ssh_config themselves. IdentitiesOnly is a boolean, and it is reported the same way it is spelled in the configuration file: yes or no.

Used by ClickHouse/ClickHouse#115072, which looks up the SSH key of clickhouse-client the same way ssh does it.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 4 committers have signed the CLA.

✅ alexey-milovidov
❌ cryptomilk
❌ Jakuje
❌ galorithm
You have signed the CLA already but the status is still pending? Let us recheck it.

alexey-milovidov added a commit to ClickHouse/ClickHouse that referenced this pull request Aug 20, 2026
…ests

Addresses the review of #115072:

- `IdentityFile` and `IdentityAgent` now expand the whole token set that `ssh`
  supports (`%C`, `%d`, `%h`, `%i`, `%L`, `%l`, `%n`, `%p`, `%r`, `%u`, `%%`),
  instead of leaving the unknown ones as is and silently probing a file that
  cannot exist. A token that is not supported is now an error.
- `IdentitiesOnly yes` is honored: the ssh-agent is no longer asked for an
  arbitrary key when none of the configured identity files exists. Retrieval of
  the option is added to `libssh` (ClickHouse/libssh#15).
- Reading the configuration, which used to happen up to three times per
  connection, happens once, in `getSSHClientConfiguration`.
- Every failure to talk to the ssh-agent is reported as `SSH_AGENT_ERROR`. A
  socket name that is too long for a Unix socket used to escape as a
  `Poco::Exception` and abort the client instead of letting it use the key file.
- `03780_failed_ssh` no longer expects the passphrase prompt, which is now asked
  only for a key that is really encrypted.
- `04908_ssh_key_file_lookup`: the heading of the last case was printed before
  the previous one, and the new cases for `%r` and `IdentitiesOnly` are added.
@alexey-milovidov alexey-milovidov changed the title Expose the configured IdentityAgent option Expose the configured IdentityAgent and IdentitiesOnly options Aug 20, 2026
@alexey-milovidov
alexey-milovidov changed the base branch from master to ClickHouse/libssh-0.12.0 August 23, 2026 01:47
@alexey-milovidov
alexey-milovidov merged commit f3a9005 into ClickHouse/libssh-0.12.0 Aug 23, 2026
alexey-milovidov added a commit to ClickHouse/ClickHouse that referenced this pull request Aug 23, 2026
…2.0`

The submodule was pinned to `2dc1be73`, the tip of the `continue-pr-115072-identity-agent-option`
branch in `ClickHouse/libssh`. That branch is deleted once its pull request lands, so the pin
would have become unreachable. ClickHouse/libssh#15 is now merged into
`ClickHouse/libssh-0.12.0` - the branch this submodule tracks - so pin its tip instead.

The tree is unchanged: `f3a90052` is the merge of the same two commits that add
`SSH_OPTIONS_IDENTITY_AGENT` and `SSH_OPTIONS_IDENTITIES_ONLY` to `ssh_options_get`.
@alexey-milovidov alexey-milovidov self-assigned this Aug 23, 2026
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.

2 participants