ssh-copy-id 找不到身份错误 [英] ssh-copy-id no identities found error

查看:36
本文介绍了ssh-copy-id 找不到身份错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户端系统很少,我需要在没有身份验证提示的情况下推送 ssh 密钥并从我的服务器登录.

I have few client systems where I need to push the ssh key and login from my server without authentication prompts.

首先,在服务器上,我创建了如下成功的 ssh 密钥

First, on the server, I created ssh key as below which was successful

]# ssh-keygen -t rsa -N "" -f my.key

其次,尝试复制公钥但失败且没有身份错误.我在这里做错了吗?

Second, tried copying the pub key but fails with no identity error. Am i doing a wrong step here?

]# ssh-copy-id my.key.pub 10.10.1.1
/usr/bin/ssh-copy-id: ERROR: No identities found

推荐答案

您需要使用 -i 标志:

ssh-copy-id -i my.key.pub 10.10.1.1

来自手册页:

如果提供了 -i 选项,则使用身份文件(默认为 ~/.ssh/id_rsa.pub),无论您的 ssh-agent 中是否有任何密钥.否则,如果: ssh-add -L 提供任何输出,它会优先使用身份文件

If the -i option is given then the identity file (defaults to ~/.ssh/id_rsa.pub) is used, regardless of whether there are any keys in your ssh-agent. Otherwise, if this: ssh-add -L provides any output, it uses that in preference to the identity file

这篇关于ssh-copy-id 找不到身份错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆