Skip to content

ProxyCommand resolving incorrect HostName if aliasing is involved #29

@reegnz

Description

@reegnz

I have jumphosts in AWS accounts, and I connect to the hosts via ec2 instance connect.
I have some artificial host names following the structure {ec2_jumphost_name}.{aws_profile_name}

My config looks something like this:

Host jumphost.*
    ProxyCommand ~/.local/bin/ec2-instance-connect-proxy-command %h %r
    IdentitiesOnly yes

Host jumphost.account_a
Host jumphost.cluster_a
    HostName jumphost.account_a

# other jumphosts following the same aliasing structure follow below
# ...

Now this setup works perfectly fine as expected using openssh.
But when I tried to use a wezterm ssh to connect to jumphost.cluster_a (using wezterm ssh jumphost.cluster_a), it does not work. I assume this is an issue in libssh-rs.

Expected: the ProxyCommand sets %h to jumphost.account_a
Actual: the ProxyCommand sets %h to jumphost.cluster_a

It feels as if the ProxyCommand gets lazily evaluated by openssh, but gets eagerly evaluated by libssh-rs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions