Handshake failed: ssh: unable to authenticate
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- docker, go
- 领域
- networking, security
调研方向
从 utils.RunSSHCommand 和 issue 中显示的 easyssh.MakeConfig 值开始,然后使用 docker-compose 针对 /root/.ssh/id_rsa 的卷映射重现身份验证失败。将容器的 SSH 环境与主机进行比较,并确认身份验证所需的配置;完成的标准是记录下原因和经过验证的解决方案。
由索引模型根据 Issue 内容生成。
描述
Hi, I'm trying to run a remote command to a host but it fails with the following error message and I can't find what is wrong:
ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
Here is the code:
const (
PKEY = "/root/.ssh/id_rsa"
)
...
output, err := utils.RunSSHCommand(user, host, PKEY, "cat /some/file")
...
func RunSSHCommand(user, addr, key, cmd string) (string, error) {
ssh := &easyssh.MakeConfig{
User: user,
Server: addr,
KeyPath: key,
Port: "22",
Timeout: 60 * time.Second,
}
stdout, stderr, done, err := ssh.Run(cmd, 60*time.Second)
if err != nil {
color.Error.Printf("[SSH Error] Cant run remote command (%s), error msg: %s\n", cmd, err.Error())
} else {
if done {
return stdout, err
} else {
color.Error.Printf("[SSH Error] Command error execution msg: %s\n", stderr)
}
}
return "", err
}
Any ideas of what could be the problem here? I've already check that the key exists. I'm running this code from a docker container, and I pass the private key from the server running the container to the container it self on the docker-compose file like these:
...
volumes:
- /root/.ssh/id_rsa:/root/.ssh/id_rsa
...
- 主要语言
- Go
- 星标
- 349
- 派生
- 64
- 平均合并
- 2 小时 29 分钟
- 30 天内合并 PR
- 2
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
appleboy/easyssh-proxy 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 42/100
appleboy/easyssh-proxy#100 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 30/100
appleboy/easyssh-proxy#92 ·
-
难度 3/5 1-2 天 新手友好度 35/100
appleboy/easyssh-proxy#88 ·
-
难度 2/5 1-3 小时 新手友好度 25/100
appleboy/easyssh-proxy#71 ·
-
难度 4/5 3-5 天 新手友好度 35/100
appleboy/easyssh-proxy#65 ·
查看 appleboy/easyssh-proxy 的全部 Issue
相似的 Issue
-
area: global bug dx priority: low
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
grafana/mcp-grafana#1267 ·
维护者通常 1 天内回复
-
automation models
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
coverage-gap good-first-pattern help wanted
难度 2/5 1-3 小时 新手友好度 78/100
GoogleCloudPlatform/k8s-aibom#114 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
txn2/mcp-data-platform#1984 ·
维护者通常 1 天内回复