Skip to main content

resolve

Function resolve 

Source
pub async fn resolve(
    ssh_dir: &Path,
    host: &str,
    user: Option<&str>,
) -> Result<ResolvedHost>
Expand description

Fully resolve config for a given host alias.

This performs:

  1. Loading and parsing the main config file.
  2. Inlining Include directives (with cycle detection).
  3. Token and environment variable expansion.
  4. First-match-wins resolution with IdentityFile accumulation.
  5. If CanonicalizeHostname is enabled, a second resolution pass using the resolved HostName as the lookup key.

user is the remote username for Match user criteria. When None, the local username is used (matching OpenSSH behaviour when no -l flag is given).

ยงErrors

Returns Error::ConfigIncludeCycle if an Include chain contains a cycle. Returns Error::Io if the config file cannot be read.