kubernetes / minikube

Run Kubernetes locally
https://minikube.sigs.k8s.io/
Apache License 2.0
29.46k stars 4.89k forks source link

minikube does not support ssh keys which are not rsa or protected with password #19111

Open oz123 opened 4 months ago

oz123 commented 4 months ago

What Happened?

If one does not specify the location of the key, you can definitely see it is looking for an RSA key, as also in this line:

https://github.com/kubernetes/minikube/blob/fb579548a8860f66b9a8cc4a28666d6c259de38c/pkg/minikube/sshutil/sshutil.go#L45

This is easily solvable with the command line flag --ssh-key=/home/oznt/.ssh/id_ed25519. However, this now fails due to the password protection of the key.

I also tried using --native-ssh=true with SSH agent running with the key added. This failed to.

These are actually 2 separate issues, which are easy to fix.

The first fix, will also look for ed25519 key in the .ssh directory, if it does not find an RSA key. The second fix, also prompt the user for an unlocking password for the key (RSA or ed255519).

Attach the log file

Looking for an RSA key:

๐Ÿ˜ฟ  Failed to start ssh bare metal machine. Running "minikube delete -p lcs" may fix it: creating host: create: creating: groups: NewSession: new client: new client: Error creating new native config from ssh using: root, &{[] [/home/oznt/.ssh/id_rsa]}: open /home/oznt/.ssh/id_rsa: no such file or directory
I0620 15:07:31.132031   17252 out.go:177] 

W0620 15:07:31.133454   17252 out.go:239] โŒ  Exiting due to GUEST_SSH_CERT_NOT_FOUND: Failed to start host: creating host: create: creating: groups: NewSession: new client: new client: Error creating new native config from ssh using: root, &{[] [/home/oznt/.ssh/id_rsa]}: open /home/oznt/.ssh/id_rsa: no such file or directory
โŒ  Exiting due to GUEST_SSH_CERT_NOT_FOUND: Failed to start host: creating host: create: creating: groups: NewSession: new client: new client: Error creating new native config from ssh using: root, &{[] [/home/oznt/.ssh/id_rsa]}: open /home/oznt/.ssh/id_rsa: no such file or directory
W0620 15:07:31.133486   17252 out.go:239] ๐Ÿ’ก  Suggestion: minikube is missing files relating to your guest environment. This can be fixed by running 'minikube delete'

Password protection:

W0620 15:06:54.920304   17202 out.go:239] ๐Ÿ˜ฟ  Failed to start ssh bare metal machine. Running "minikube delete -p lcs" may fix it: creating host: create: precreate: SSH key does not parse: "/home/oznt/.ssh/id_ed25519": ssh: this private key is passphrase protected
๐Ÿ˜ฟ  Failed to start ssh bare metal machine. Running "minikube delete -p lcs" may fix it: creating host: create: precreate: SSH key does not parse: "/home/oznt/.ssh/id_ed25519": ssh: this private key is passphrase protected
I0620 15:06:54.932952   17202 out.go:177] 

W0620 15:06:54.937177   17202 out.go:239] โŒ  Exiting due to GUEST_PROVISION: error provisioning guest: Failed to start host: creating host: create: precreate: SSH key does not parse: "/home/oznt/.ssh/id_ed25519": ssh: this private key is passphrase protected
โŒ  Exiting due to GUEST_PROVISION: error provisioning guest: Failed to start host: creating host: create: precreate: SSH key does not parse: "/home/oznt/.ssh/id_ed25519": ssh: this private key is passphrase protected
W0620 15:06:54.937202   17202 out.go:239] 

Operating System

Ubuntu

Driver

SSH

k8s-triage-robot commented 1 month ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 3 weeks ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten