Skip to content

docs(vm): clarify --ssh-public-key creates user from key comment#708

Open
jdewinne wants to merge 1 commit intomainfrom
joshd/sc-136594/replicated-vm-create-ssh-public-key-doesn
Open

docs(vm): clarify --ssh-public-key creates user from key comment#708
jdewinne wants to merge 1 commit intomainfrom
joshd/sc-136594/replicated-vm-create-ssh-public-key-doesn

Conversation

@jdewinne
Copy link
Copy Markdown
Member

Summary

  • replicated vm create --ssh-public-key accepts the key fine, but the Linux user the key gets added to on the VM is derived from the key's comment (the portion before the first @). The help text didn't mention this, so users assumed the key would land on ubuntu or on the Vendor Portal GitHub username that vm ssh-endpoint returns, and SSH as that user failed.
  • Updated the --ssh-public-key flag description, the shared long help for vm ssh-endpoint / vm scp-endpoint, and the --username flag description to call out the create→endpoint username relationship. Added an end-to-end example to vm create showing ssh-keygen -C ci@hostvm create --ssh-public-keyvm ssh-endpoint --username cissh -i.
  • Bumped stale --version 20.04 references in the example block to 22.04 (20.04 is no longer in the supported version list returned by vm versions --distribution ubuntu).

No behavior changes — help text only.

Verified the underlying behavior end-to-end against a real CMX VM: created an Ubuntu 22.04 VM with a key whose comment was joshtester@laptop42, confirmed user joshtester (uid 1002) was provisioned with the key in ~/.ssh/authorized_keys and passwordless sudo, while ssh ubuntu@… and the username vm ssh-endpoint returned both fail.

Refs sc-136594.

Test plan

  • go build ./... clean
  • replicated vm create --help renders new flag description and the new example
  • replicated vm ssh-endpoint --help renders new long-help paragraph and updated --username description
  • replicated vm scp-endpoint --help picks up the same shared note (correct — same gotcha applies)
  • End-to-end SSH flow with a comment-derived username works against a live CMX VM

The --ssh-public-key flag accepts the key, but the Linux user that
receives it is derived from the key's comment (the portion before the
first '@'). The help text did not mention this, so users assumed the
key would land on the same user `vm ssh-endpoint` returns (the Vendor
Portal GitHub username) and SSH attempts as that user failed.

Update the flag descriptions and the shared long help for
ssh-endpoint/scp-endpoint, and add an end-to-end create-then-ssh
example. Also bump stale Ubuntu 20.04 references in the example block
to 22.04, since 20.04 is not in the supported version list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant