用SSH密钥配置一个新的数字海洋液滴。当我运行ssh-copy-id时,这是我得到的:

ssh-copy-id user@012.345.67.89
/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
user@012.345.67.89's password: 

Number of key(s) added: 1

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

然而,当我尝试ssh时,会发生这种情况:

ssh user@012.345.67.89
sign_and_send_pubkey: signing failed: agent refused operation
user@012.345.67.89's password: 

输入密码后,我可以正常登录,但这当然违背了创建SSH密钥的初衷。我决定看看ssh-agent服务器端,下面是我得到的:

user@012.345.67.89:~# eval `ssh-agent -s`
Agent pid 5715
user@012.345.67.89:~# ssh-add -l
The agent has no identities.

用户/。Ssh /authorized_keys也包含Ssh -rsa密钥条目,但是find name "keynamehere"没有返回任何内容。


当前回答

对于这个错误:

# git pull
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).    
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

在Github帐户>配置文件> ssh中再次验证或添加公钥。

我是这样解决的:

# chmod 400 ~/.ssh/id_rsa

# ls  ~/.ssh/id_rsa -ls  
4 -r--------. 1 reinaldo reinaldo 1679 Jul 26  2017 /home/reinaldo/.ssh/id_rsa

# git pull                                 
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 35 (delta 9), reused 34 (delta 9), pack-reused 0
Unpacking objects: 100% (35/35), done.

谢谢你!

其他回答

这里工作的是:在客户端上

1) ssh-add

2) ssh-copy-id user@server

密钥已经在一段时间前使用简单的“ssh-keygen -t rsa”创建 我看到了错误消息,因为我没有首先运行ssh-add就将ssh公钥从客户端复制到服务器(使用ssh-id-copy),因为我错误地认为我已经在一段时间之前添加了它们。

只是为了把另一个原因扔进擂台……

我的env被配置为使用金雅拓卡…但是我的~/中有一个名为id_rsa_gemalto_old(.pub)的旧对。Ssh /——名字中有gemalto——足以让git获取导致sign_and_send_pubkey: signing failed: agent refused操作。

(Ubuntu 18.04.6)

对于这个错误:

# git pull
sign_and_send_pubkey: signing failed: agent refused operation
git@github.com: Permission denied (publickey).    
fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

在Github帐户>配置文件> ssh中再次验证或添加公钥。

我是这样解决的:

# chmod 400 ~/.ssh/id_rsa

# ls  ~/.ssh/id_rsa -ls  
4 -r--------. 1 reinaldo reinaldo 1679 Jul 26  2017 /home/reinaldo/.ssh/id_rsa

# git pull                                 
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 35 (delta 9), reused 34 (delta 9), pack-reused 0
Unpacking objects: 100% (35/35), done.

谢谢你!

在将Fedora 26升级到28之后,我遇到了同样的问题。 下面的日志也不见了

/var/log/secure
/var/log/messages

问题:

antop@localmachine  ~  ssh root@ocp1.example.com
sign_and_send_pubkey: signing failed: agent refused operation
root@ocp1.example.com's password:

错误信息没有指向实际问题。问题由

chmod 700 ~/.ssh
chmod 600 ~/.ssh/*

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

对的,我在MacOSX SourceTree中有完全相同的错误,然而,在iTerm2终端中,事情工作得很好。

然而,问题似乎是我有两个ssh代理运行;(

第一个是/usr/bin/ssh-agent(也就是MacOSX的),然后是HomeBrew安装的/usr/local/bin/ssh-agent。

从SourceTree启动一个终端,允许我看到SSH_AUTH_SOCK的差异,使用lsof我找到了两个不同的ssh-代理,然后我能够将密钥(使用ssh-add)加载到系统的默认ssh-代理(即。/usr/bin/ssh-agent), SourceTree恢复正常。