cloudflared icon indicating copy to clipboard operation
cloudflared copied to clipboard

fix: add windows specific ssh-config

Open Bexanderthebex opened this issue 1 year ago • 1 comments

This attempts to fix https://github.com/cloudflare/cloudflared/issues/753

The bug occurs because windows executable uses the current working directory to do its operations while the ssh-config being generated assumes that:

  1. the user uses a nix machine
  2. the nix executable follows a different installation directory than windows. Windows uses the relative path, the nix binary gets stored in ~/.cloudflared

Bexanderthebex avatar Oct 28 '22 07:10 Bexanderthebex

@GreenStage thank you for taking a look. I did the changes on my windows partition and forget about the spacing (I don't use it a lot) so thank you for noticing that.

Bexanderthebex avatar Nov 16 '22 09:11 Bexanderthebex

@jroyal wonder if you can take a look?

Bexanderthebex avatar Jun 01 '23 07:06 Bexanderthebex

Generated

Host cfpipe-ssh.hotdogs.beauty
  ProxyCommand C:\Users\EduardoGomes\cloudflared\cloudflared.exe access ssh-gen --hostname %h && ssh -tt %[email protected] >&2 <&1

Host cfpipe-ssh.hotdogs.beauty
  HostName ssh.hotdogs.beauty
  ProxyCommand C:\Users\EduardoGomes\cloudflared\cloudflared.exe access ssh --hostname %h IdentityFile <REDACTED>
  CertificateFile <REDACTED>

after which, I got timedout when sshing to my remote machine

C:\Users\EduardoGomes>ssh -v ssh.hotdogs.beauty
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Reading configuration data C:\\Users\\EduardoGomes/.ssh/config
debug1: Connecting to ssh.hotdogs.beauty [172.67.201.145] port 22.
debug1: connect to address 104.21.52.171 port 22: Connection timed out

GreenStage avatar Jun 09 '23 15:06 GreenStage

Feel free to rebase and reopen it if it's still relevant.

chungthuang avatar Mar 05 '24 17:03 chungthuang