Skip to content
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

podman: Update VM ssh key #17

Closed
Tracked by #9
cfergeau opened this issue Nov 20, 2024 · 1 comment
Closed
Tracked by #9

podman: Update VM ssh key #17

cfergeau opened this issue Nov 20, 2024 · 1 comment
Assignees

Comments

@cfergeau
Copy link
Owner

cfergeau commented Nov 20, 2024

podman machine generates a SSH key, and injects it in a generic VM image using ignition.

crc does not use ignition/cloud-init/..., but relies on a hardcoded 'default' key (part of the bundle), and early during the first boot, it replaces it with a newly generated key.

In order to support crc use case we need to either:

  1. figure out how to update the SSH key used by podman-machine
  2. change snc/crc to use an approach similar to podman's

It's probably easier to go with 1) for now, and to look into 2) as part of the self-sufficient bundle work.

@cfergeau
Copy link
Owner Author

  1. was done using:
func (d *Driver) UpdateSSHConfig(sshConfig drivers.SSHConfig) error {
	d.vmConfig.Lock()
	defer d.vmConfig.Unlock()
	if err := d.vmConfig.Refresh(); err != nil {
		return fmt.Errorf("reload config: %w", err)
	}
	d.vmConfig.SSH.Port = sshConfig.Port
	d.vmConfig.SSH.IdentityPath = sshConfig.IdentityPath
	d.vmConfig.SSH.RemoteUsername = sshConfig.RemoteUsername
	return d.vmConfig.Write()
}

@github-project-automation github-project-automation bot moved this from Todo to Done in Project planning: crc Nov 28, 2024
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

No branches or pull requests

1 participant