🐛 ssh-config w/ short-lived-cert thrown off by invalid characters in hostname #923
Labels
Area: Access
Issue related with cloudflared access
Priority: Normal
Minor issue impacting one or more users
Type: Bug
Something isn't working
Describe the bug
The config generated by
cloudflared access ssh-config --short-lived-cert
does not work when--hostname
contains invalid characters. This prevents using the config directly for otherwise functional addresses likesubdomain.example.com/ssh
.To Reproduce
Steps to reproduce the behavior:
cloudflared tunnel
on SSH server side, etc.cloudflared access ssh-config --hostname subdomain.example.com/ssh --short-lived-cert
on clientThe following config is generated:
Note the use of
%h
in IdentityFile and CertificateFile3. Run
ssh subdomain.example.com/ssh
This creates the files
subdomain.example.com-ssh-{cf_key|cf_key.pub|cf_key-cert.pub}
. Note that the forward slash has been converted to a hyphen.4.
ssh
fails with the following error:This is as expected, as
%h
=subdomain.example.com/ssh
!=subdomain.example.com-ssh
.Expected behavior
The config should point to the correct file, such that ssh is able to find the identity file and connect successfully. I propose that
%h
be substituted for the escaped value for the IdentityFile and CertificateFile definitions (optionally, we could instead do this only when the hostname is found to contain invalid characters):This is my current workaround, and I can confirm that ssh access works fine in this case.
Environment and versions
The text was updated successfully, but these errors were encountered: