Skip to content

bug: config-ssh writes bad Match exec clause on Windows #18199

Closed
@spikecurtis

Description

@spikecurtis

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

coder config-ssh writes a config stanza like

# ------------START-CODER-----------
# This section is managed by coder. DO NOT EDIT.
#
# You should not hand-edit this section unless you are removing it, all
# changes will be lost when running "coder config-ssh".
#
Host coder.*
        ConnectTimeout=0
        StrictHostKeyChecking=no
        UserKnownHostsFile=/dev/null
        LogLevel ERROR
        ProxyCommand "C:\Program Files\Coder\bin\coder.exe" --global-config C:\Users\micha\AppData\Roaming\coderv2 ssh --stdio --ssh-host-prefix coder. %h

Host *.coder
        ConnectTimeout=0
        StrictHostKeyChecking=no
        UserKnownHostsFile=/dev/null
        LogLevel ERROR

Match host *.coder !exec ""C:\Program Files\Coder\bin\coder.exe" connect exists %h"
        ProxyCommand "C:\Program Files\Coder\bin\coder.exe" --global-config C:\Users\micha\AppData\Roaming\coderv2 ssh --stdio --hostname-suffix coder %h
# ------------END-CODER------------

This results in a failed ssh invocation

C:\Users\micha\Downloads> ssh net-integration.coder
Missing Match criteria for exec
C:\\Users\\micha/.ssh/config line 66: Bad Match condition
C:\\Users\\micha/.ssh/config: terminating, 1 bad configuration options

Relevant Log Output

Expected Behavior

ssh should connect

Steps to Reproduce

  1. Install Coder on Windows to a path with a space in it like C:\Program Files\Coder\
  2. run coder config-ssh
  3. run ssh <workspace>

Environment

  • Host OS: Windows 11
  • Coder version: 2.22.0

Additional Context

No response

Metadata

Metadata

Assignees

Labels

regressionSomething that used to work but no longer workss1Bugs that break core workflows. Only humans may set this.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions