ubuntu - 如何配置 minikube ssh?
问题描述
我正在尝试在 Ubuntu 18.04 上使用 kvm 启动 Kubernetes minikube (v0.32.0)
但是,它在运行时挂起
:minikube start --vm-driver kvm2 -v 10
或minikube 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"
解决方案
你的虚拟机真的启动了吗?您是在裸机还是嵌套虚拟化上运行?通常,您连接到 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",
...
}
推荐阅读
- javascript - 使用 Javascript 从 URL 中删除子目录
- rabbitmq - rabbitmq - 检测“空闲”队列
- java - Swing 组件的线程同步
- node.js - 运行电子应用程序出现错误“futex 工具返回了意外错误”
- javascript - UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“播放”
- javascript - 使用流实现去抖动分块异步队列
- vue.js - Vue:道具值更改不更新 DOM
- linux - Apache反向代理不加载资源
- javascript - 在 Edge chromium 浏览器中,Tiny MCE javascript 富文本编辑器(v3.5.10)在 MVC 4 Web 应用程序中抛出错误,而它在 IE11 中工作正常
- django - 多阶段 Docker 构建失败 - 错误:标志值无效