Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Modify user SSH config with single Include statement instead of managed block #1326

Closed
@mafredri

Description

@mafredri

What is your suggestion?

We could improve the user experience by only adding a single line to the users SSH config. This would achieve the same functionality that we have currently whilst keeping the users SSH config cleaner and not rely on magic syntax.

~/.ssh/config:

Include coder.d/*

We probably want to include a comment explaining the line, but it's all that's required.

~/.ssh/coder.d/workspace-name:

Host coder.workspace-name
	HostName coder.workspace-name
	...

To ensure the coder SSH config is active, we only need to check for the presence of Include coder.d/* but the user is allowed to move it anywhere in the config.

This would replace the current approach of using a block in ~/.ssh/config:

# ------------START-CODER-----------
# This was generated by "coder config-ssh".
#
# To remove this blob, run:
#
#    coder config-ssh --remove
#
# You should not hand-edit this section, unless you are deleting it.`
Host coder.workspace-name
	HostName coder.workspace-name
	...
# ------------END-CODER------------

This functionality was released in OpenSSH 7.3p1 (2016-08-01), I think it's fairly safe to assume that this version of SSH at minimum will be available, or do we know of cases where this is not true?

Why do you want this feature?

After a discussion in BE Variety we concluded that it would be a nice improvement to the user experience to make a more minimal one-time change to the user SSH config.

Generally users don't like it when programs make changes to their configuration files, this change is minimal and perhaps more acceptable. Especially if the user is informed that it's a one-time addition.

Are there any workarounds to get this functionality today?

We could continue using the existing functionality.

Are you interested in submitting a PR for this?

Yes.

Metadata

Metadata

Assignees

Labels

apiArea: HTTP APIcliArea: CLI

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions