本文共 819 字,大约阅读时间需要 2 分钟。
目录
问题
报错信息:error: open /var/root/.ssh/id_rsa: permission denied。
具体日志信息:
2021/03/09 14:28:08 main.go:240: clientConfig: &{
{<nil> 0 [] [] []} [] <nil> <nil> [] 0s}2021/03/09 14:28:08 main.go:242: error: open /var/root/.ssh/id_rsa: permission denied
2021/03/09 14:28:08 main.go:252: Couldn't establish a connection to the remote server ssh: must specify HostKeyCallback
2021/03/09 14:28:38 main.go:231: 检查任务列表
2021/03/09 14:28:38 main.go:328: 检查可用服务器
2021/03/09 14:28:38 main.go:331: 遍历 v= {0 172.31.102.228 3000 1}
类似
报错2:
Couldn't establish a connection to the remote server ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
报错3:
error: ssh: no key found
解决
1. 首先,自己确定了用户名是root没有问题。
2. 其次,scp端口默认是22。
3. 最后,服务启动方式也必须是root才可以,比如mac的话,可以使用 sudo su 命令切换。
转载地址:https://liuzhen.blog.csdn.net/article/details/114630451 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!