2017-05-29 67 views
12

使用SSH密钥配置新的数字海洋液滴。当我运行ssh-copy-id这是我得到:sign_and_send_pubkey:签名失败:代理拒绝操作

ssh-copy-id [email protected] 
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed 
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys 
sign_and_send_pubkey: signing failed: agent refused operation 
[email protected]'s password: 

Number of key(s) added: 1 

Now try logging into the machine, with: "ssh '[email protected]'" 
and check to make sure that only the key(s) you wanted were added. 

然而,当我再尝试用ssh的,出现这种情况:

ssh [email protected] 
sign_and_send_pubkey: signing failed: agent refused operation 
[email protected]'s password: 

当输入了密码,我登录就好了,但这当然会首先破坏创建SSH密钥的目的。我决定去看看SSH代理服务器端和这里就是我得到:

[email protected]:~# eval `ssh-agent -s` 
Agent pid 5715 
[email protected]:~# ssh-add -l 
The agent has no identities. 

用户/的.ssh/authorized_keys中确实包含一个支持SSH-RSA密钥条目,以及,但find -name "keynamehere"回报什么。

回答

32

在客户机上运行ssh-add,这会将SSH密钥添加到代理。

ssh-add -l(再次在客户端)确认它确实已添加。

+1

geez,花了两个小时试图解决这个问题,这就是它!修复了bitbucket和acquia ssh连接 – Ronnie

+5

它并没有完全解决它,因为我使用'gpg-agent'进行SSH功能。我已经在'gpg-agent.conf'中有'enable-ssh-support',但仍然有相同的错误信息。我发现在邮件列表上运行:'gpg-connect-agent updatestartuptty/bye':https://bugs.debian.org/cgi-bin/bugreport.cgi?bug = 835394 – Roland

+0

我只好杀了gpg - 然后再运行它。 – Subin

0

这应该是一个超级用户的问题。

对我在MacOSX SourceTree中有完全相同的错误,但是,在iTerm2终端内,事情只是花花公子。

然而,问题似乎是,我有 ssh-agent正在竞选;(

第一个是/usr/bin/ssh-agent(又名的MacOSX的),然后还安装了自制/usr/local/bin/ssh-agent运行

射击。从SourceTree启动一个终端,允许我看到SSH_AUTH_SOCK中的差异,使用lsof我找到了两个不同的ssh-agent s,然后我能够将密钥(使用ssh-add)加载到系统的默认ssh-agent(即/usr/bin/ssh-agent),SourceTree再次工作。

相关问题