Skip to content

docs: update SSH command format to use suffix #18085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func (r *RootCmd) configSSH() *serpent.Command {
cmd := &serpent.Command{
Annotations: workspaceCommand,
Use: "config-ssh",
Short: "Add an SSH Host entry for your workspaces \"ssh coder.workspace\"",
Short: "Add an SSH Host entry for your workspaces \"ssh workspace.coder\"",
Long: FormatExamples(
Example{
Description: "You can use -o (or --ssh-option) so set SSH options to be used for all your workspaces",
Expand Down
2 changes: 1 addition & 1 deletion cli/testdata/coder_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ SUBCOMMANDS:
completion Install or update shell completion scripts for the
detected or chosen shell.
config-ssh Add an SSH Host entry for your workspaces "ssh
coder.workspace"
workspace.coder"
create Create a workspace
delete Delete a workspace
dotfiles Personalize your workspace by applying a canonical
Expand Down
2 changes: 1 addition & 1 deletion cli/testdata/coder_config-ssh_--help.golden
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ coder v0.0.0-devel
USAGE:
coder config-ssh [flags]

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

- You can use -o (or --ssh-option) so set SSH options to be used for all
your
Expand Down
2 changes: 1 addition & 1 deletion docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@
},
{
"title": "config-ssh",
"description": "Add an SSH Host entry for your workspaces \"ssh coder.workspace\"",
"description": "Add an SSH Host entry for your workspaces \"ssh workspace.coder\"",
"path": "reference/cli/config-ssh.md"
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/cli/config-ssh.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/cli/index.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/tutorials/testing-templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,8 @@ jobs:
- name: Create a test workspace and run some example commands
run: |
coder create -t $TEMPLATE_NAME --template-version ${{ steps.name.outputs.version_name }} test-${{ steps.name.outputs.version_name }} --yes
coder config-ssh --yes
# run some example commands
ssh coder.test-${{ steps.name.outputs.version_name }} -- make build
coder ssh test-${{ steps.name.outputs.version_name }} -- make build

- name: Delete the test workspace
if: always()
Expand Down
1 change: 1 addition & 0 deletions site/src/modules/resources/AgentRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export const AgentRow: FC<AgentRowProps> = ({
<AgentSSHButton
workspaceName={workspace.name}
agentName={agent.name}
workspaceOwnerUsername={workspace.owner_name}
/>
)}
{proxy.preferredWildcardHostname !== "" &&
Expand Down
6 changes: 4 additions & 2 deletions site/src/modules/resources/SSHButton/SSHButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ import { docs } from "utils/docs";
interface AgentSSHButtonProps {
workspaceName: string;
agentName: string;
workspaceOwnerUsername: string;
}

export const AgentSSHButton: FC<AgentSSHButtonProps> = ({
workspaceName,
agentName,
workspaceOwnerUsername,
}) => {
const paper = useClassName(classNames.paper, []);
const { data } = useQuery(deploymentSSHConfig());
const sshPrefix = data?.hostname_prefix;
const sshSuffix = data?.hostname_suffix;

return (
<Popover>
Expand Down Expand Up @@ -58,7 +60,7 @@ export const AgentSSHButton: FC<AgentSSHButtonProps> = ({
/>
<SSHStep
helpText="Connect to the agent:"
codeExample={`ssh ${sshPrefix}${workspaceName}.${agentName}`}
codeExample={`ssh ${workspaceName}.${agentName}.${workspaceOwnerUsername}.${sshSuffix}`}
/>
</Stack>
</ol>
Expand Down
Loading