This repository was archived by the owner on Feb 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 530
docs: add ssh key for vmware doc #1175
Open
zbwright
wants to merge
1
commit into
master
Choose a base branch
from
vmware-ssh
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Adding SSH keys for VMWare | ||
|
||
Most installations of Container Linux on VMWare require an SSH key to access the machine. Use a [Container Linux Config][cl-config] with a valid SSH key and the [Config Transpiler][config-transpiler] to create the ignition config. Then pass that ignition config to the VMWare image’s VMX file to enable SSH access to the machine. | ||
|
||
Modify the VMX file to pass an [Ignition Config][ignition-config] containing at least one valid SSH key. | ||
|
||
First, follow the instructions to Boot with VMware Workstation 12 or VMware Fusion to create a VM. (Do not start / power on the the VM. These instructions will work only on the first boot.) | ||
|
||
Next, create and apply the SSH key: | ||
|
||
1. [Download Config Transpiler][download-ct]. | ||
|
||
2. Follow the instructions to [add an SSH public key][add-ssh] to the Container Linux Config (for example `id_rsa.pub`). | ||
|
||
``` | ||
passwd: | ||
users: | ||
- name: core | ||
ssh_authorized_keys: | ||
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC0g+ZTxC7weoIJLUafOgrm+h..." | ||
``` | ||
|
||
3. Use Config Transpiler to convert the Container Linux Config YAML to Ignition Config, then base64 encode the Ignition config. | ||
|
||
``` | ||
$ ./ct --in-file config.yaml | base64 | ||
``` | ||
|
||
Remove any newline characters from the encoded output. | ||
|
||
4. Open the VM’s VMX file in your favorite text editor, and add the base64 encoded Ignition Config to the VMWare image’s VMX file under Guestinfo as outlined in [Defining the Ignition config in Guestinfo][define-guestinfo]. | ||
|
||
``` | ||
guestinfo.coreos.config.data = "<<Output of the base64 encoded ignition file>>>" | ||
guestinfo.coreos.config.data.encoding = "base64" | ||
``` | ||
|
||
5. Save the VMX file and boot the VM for the first time. | ||
|
||
Once booted, use `$ ssh core@<<ip address>>` to SSH into the machine. If you haven’t added the SSH key to the SSH agent, specify the key using the `-i` flag: | ||
|
||
`$ ssh -i <<path to ssh public key>> core@<<ip address>>` | ||
|
||
|
||
[add-ssh]: https://coreos.com/os/docs/latest/migrating-to-clcs.html#ssh_authorized_keys | ||
[config-transpiler]: https://coreos.com/os/docs/latest/overview-of-ct.html | ||
[define-guestinfo]: https://coreos.com/os/docs/latest/booting-on-vmware.html#defining-the-ignition-config-in-guestinfo | ||
[download-ct]: https://github.com/coreos/container-linux-config-transpiler/releases/ | ||
[ignition-config]: https://coreos.com/os/docs/latest/provisioning.html#ignition-config | ||
[cl-config]: https://coreos.com/os/docs/latest/provisioning.html |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line can be dropped, and
can be added to the previous command.