Agent admitted failure to sign using the key 问题解决办法

本文分享了在Ubuntu系统中安装SSH过程中遇到的错误及解决办法。主要问题为使用命令ssh localhost时出现“Agent admitted failure to sign using the key”错误。通过使用ssh-add指令将私钥加入,并执行ssh-agent bash --login –i命令来解决问题。

以下是我在ubuntu中安装ssh过程中遇到的问题,解决办法在网上搜寻到的,感谢广大热心的先行者,谢谢!

问题:将cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys 将公钥加到authorized_keys中

后,使用命令ssh localhost 时出现Agent admitted failure to sign using the key 这样的错误信息。

解决办法:使用 ssh-add 指令将私钥加进来(根据个人的密匙命名不同更改 id_rsa),使用命令:# ssh-add   ~/.ssh/id_rsa

一般来说这样就可以执行 ssh localhost 命令了,不过我在经上面处理之后,得到的是如下的提示:

Could not open a connection to your authentication agent

不急这个也是有解决办法的,即先在shell下执行 ssh-agent bash --login –i ,然后再执行 ssh-add 就好了!

我也是初学者,遇到问题不要怕,不要急,静下心,肯定是有解决办法的!绝大部分问题之前肯定是出现过的,网友也是很热心的!我们一起努力,共建互帮互助的学习网络!

测试 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值