如何配置minikube ssh?

时间:2018-12-26 18:13:30

标签: ubuntu ssh kubernetes

我试图在

之后在Ubuntu 18.04上使用kvm启动Kubernetes minikube(v0.32.0)
  

https://kubernetes.io/docs/setup/minikube/

但是,它在运行时挂起: minikube start --vm-driver kvm2 -v 10minikube ssh -v 10

Error dialing TCP: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain

我可以使用“ ssh docker@192.168.39.98”连接到minikube VM,因此我相信minikube ssh不起作用,因为它不使用相同的参数。我该如何配置呢?

  • 我确实设法使用docker / tcuser通过kvm前端登录到minikube并复制了我的公共ssh密钥,但这没有帮助。
  • 我用于身份验证的〜/ .minikube / machines / minikube / config.json是:
"AuthOptions": {
            "CertDir": "/home/badgers/.minikube",
            "CaCertPath": "/home/badgers/.minikube/certs/ca.pem",
            "CaPrivateKeyPath": "/home/badgers/.minikube/certs/ca-key.pem",
            "CaCertRemotePath": "",
            "ServerCertPath": "/home/badgers/.minikube/machines/server.pem",
            "ServerKeyPath": "/home/badgers/.minikube/machines/server-key.pem",
            "ClientKeyPath": "/home/badgers/.minikube/certs/key.pem",
            "ServerCertRemotePath": "",
            "ServerKeyRemotePath": "",
            "ClientCertPath": "/home/badgers/.minikube/certs/cert.pem",
            "ServerCertSANs": null,
            "StorePath": "/home/badgers/.minikube"

1 个答案:

答案 0 :(得分:1)

您的VM是否真的启动了?您是在裸机还是嵌套虚拟化上运行?通常,您用于连接虚拟机的ssh私钥位于以下位置:

/home/badgers/.minikube/machines/minikube/id_rsa

您可以使用以下方法进行检查:

$ minikube ssh-key

这也由您配置中的SSHKeyPath选项标识:

{
    "ConfigVersion": 3,
    "Driver": {
        "IPAddress": "192.168.x.x",
        "MachineName": "minikube",
        "SSHUser": "docker",
        "SSHPort": 22,
        "SSHKeyPath": "/home/badgers/.minikube/machines/minikube/id_rsa",
        ...
}