# config-ssh

Add an SSH Host entry for your workspaces "ssh workspace.coder"

## Usage [#usage]

```console
coder config-ssh [flags]
```

## Description [#description]

```console
  - You can use -o (or --ssh-option) so set SSH options to be used for all your
workspaces:

     $ coder config-ssh -o ForwardAgent=yes

  - You can use --dry-run (or -n) to see the changes that would be made:

     $ coder config-ssh --dry-run
```

## Options [#options]

### --ssh-config-file [#--ssh-config-file]

|             |                                        |
| ----------- | -------------------------------------- |
| Type        | <code>string</code>                    |
| Environment | <code>$CODER\_SSH\_CONFIG\_FILE</code> |
| Default     | <code>\~/.ssh/config</code>            |

Specifies the path to an SSH config.

### --coder-binary-path [#--coder-binary-path]

|             |                                                |
| ----------- | ---------------------------------------------- |
| Type        | <code>string</code>                            |
| Environment | <code>$CODER\_SSH\_CONFIG\_BINARY\_PATH</code> |

Optionally specify the absolute path to the coder binary used in ProxyCommand. By default, the binary invoking this command ('config ssh') is used.

### -o, --ssh-option [#-o---ssh-option]

|             |                                        |
| ----------- | -------------------------------------- |
| Type        | <code>string-array</code>              |
| Environment | <code>$CODER\_SSH\_CONFIG\_OPTS</code> |

Specifies additional SSH options to embed in each host stanza.

### -n, --dry-run [#-n---dry-run]

|             |                                    |
| ----------- | ---------------------------------- |
| Type        | <code>bool</code>                  |
| Environment | <code>$CODER\_SSH\_DRY\_RUN</code> |

Perform a trial run with no changes made, showing a diff at the end.

### --use-previous-options [#--use-previous-options]

|             |                                                  |
| ----------- | ------------------------------------------------ |
| Type        | <code>bool</code>                                |
| Environment | <code>$CODER\_SSH\_USE\_PREVIOUS\_OPTIONS</code> |

Specifies whether or not to keep options from previous run of config-ssh.

### --ssh-host-prefix [#--ssh-host-prefix]

|             |                                                   |
| ----------- | ------------------------------------------------- |
| Type        | <code>string</code>                               |
| Environment | <code>$CODER\_CONFIGSSH\_SSH\_HOST\_PREFIX</code> |

Override the default host prefix.

### --hostname-suffix [#--hostname-suffix]

|             |                                                  |
| ----------- | ------------------------------------------------ |
| Type        | <code>string</code>                              |
| Environment | <code>$CODER\_CONFIGSSH\_HOSTNAME\_SUFFIX</code> |

Override the default hostname suffix.

### --wait [#--wait]

|             |                                      |
| ----------- | ------------------------------------ |
| Type        | <code>yes\|no\|auto</code>           |
| Environment | <code>$CODER\_CONFIGSSH\_WAIT</code> |
| Default     | <code>auto</code>                    |

Specifies whether or not to wait for the startup script to finish executing. Auto means that the agent startup script behavior configured in the workspace template is used.

### --disable-autostart [#--disable-autostart]

|             |                                                    |
| ----------- | -------------------------------------------------- |
| Type        | <code>bool</code>                                  |
| Environment | <code>$CODER\_CONFIGSSH\_DISABLE\_AUTOSTART</code> |
| Default     | <code>false</code>                                 |

Disable starting the workspace automatically when connecting via SSH.

### --no-wildcard [#--no-wildcard]

|             |                                              |
| ----------- | -------------------------------------------- |
| Type        | <code>bool</code>                            |
| Environment | <code>$CODER\_CONFIGSSH\_NO\_WILDCARD</code> |
| Default     | <code>false</code>                           |

Generate an individual host entry for each workspace instead of a wildcard host block. This allows third-party tools and SSH clients to discover workspaces by reading the config file.

### --force-unix-filepaths [#--force-unix-filepaths]

|             |                                                 |
| ----------- | ----------------------------------------------- |
| Type        | <code>bool</code>                               |
| Environment | <code>$CODER\_CONFIGSSH\_UNIX\_FILEPATHS</code> |

By default, 'config-ssh' uses the os path separator when writing the ssh config. This might be an issue in Windows machine that use a unix-like shell. This flag forces the use of unix file paths (the forward slash '/').

### -y, --yes [#-y---yes]

|      |                   |
| ---- | ----------------- |
| Type | <code>bool</code> |

Bypass confirmation prompts.
