解决 Agent admitted failure to sign using the key 问题 with ssh

本文介绍了一种常见的SSH连接问题——使用公钥认证时出现的“Agent admitted failure to sign using the key”错误,并提供了相应的解决方案,即通过ssh-add命令添加私钥。

本文来自:

http://sakananote2.blogspot.com/2010/07/agent-admitted-failure-to-sign-using.html

 

 

之前如果建立 ssh 连接,
只要將公鑰複製到 ~/.ssh/authorized_keys 就可以利用金鑰登入
而不需要建立密碼.

現在的 ssh 使用同樣的方法會出現錯誤訊息

Agent admitted failure to sign using the key


解決方式 使用 ssh-add 指令將私鑰 加進來 (根据个人的密匙命名不同更改 id_rsa)
# ssh-add   ~/.ssh/id_rsa 

测试 SSH 基础连接 # 使用相同参数测试连接 ssh -v -p [端口] -i ~/.ssh/id_rsa [用户名]@[服务器IP] 观察 debug1: Authentications that can continue 后的错误提示: debug1: load_hostkeys: fopen /Users/jolinjiang/.ssh/known_hosts: No such file or directory debug1: load_hostkeys: fopen /Users/jolinjiang/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: checking without port identifier debug1: load_hostkeys: fopen /Users/jolinjiang/.ssh/known_hosts: No such file or directory debug1: load_hostkeys: fopen /Users/jolinjiang/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory debug1: hostkeys_find_by_key_hostfile: hostkeys file /Users/jolinjiang/.ssh/known_hosts does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /Users/jolinjiang/.ssh/known_hosts2 does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts does not exist debug1: hostkeys_find_by_key_hostfile: hostkeys file /etc/ssh/ssh_known_hosts2 does not exist The authenticity of host '[fox-telemarket.starklotus.com]:36000 ([149.129.235.174]:36000)' can't be established. ED25519 key fingerprint is SHA256:/g3xmRHaPBpl4W5WUIcgHNyzPKjt5gCadvKC/8hlTZY. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added '[fox-telemarket.starklotus.com]:36000' (ED25519) to the list of known hosts. debug1: rekey out after 4294967296 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug1: SSH2_MSG_NEWKEYS received debug1: rekey in after 4294967296 blocks debug1: SSH2_MSG_EXT_INFO received debug1: kex_ext_info_client_parse: server-sig-algs=<rsa-sha2-256,rsa-sha2-512> debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Next authentication method: publickey debug1: get_agent_identities: bound agent to hostkey debug1: get_agent_identities: agent returned 1 keys debug1: Will attempt key: /Users/jolinjiang/.ssh/id_rsa RSA SHA256:HnRtogpLB7+VvzDy1C4Z/8RX5duqmYaBju7QMAC70hA explicit agent debug1: Will attempt key: /Users/jolinjiang/.ssh/id_rsa RSA SHA256:HnRtogpLB7+VvzDy1C4Z/8RX5duqmYaBju7QMAC70hA explicit debug1: Offering public key: /Users/jolinjiang/.ssh/id_rsa RSA SHA256:HnRtogpLB7+VvzDy1C4Z/8RX5duqmYaBju7QMAC70hA explicit agent debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: Offering public key: /Users/jolinjiang/.ssh/id_rsa RSA SHA256:HnRtogpLB7+VvzDy1C4Z/8RX5duqmYaBju7QMAC70hA explicit debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic debug1: No more authentication methods to try. jolinjiang@fox-telemarket.starklotus.com: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
最新发布
08-27
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值