github - linux 下git 出现问题Permission denied (publickey).,在线等,急
ringa_lee
ringa_lee 2017-04-17 13:23:40
[Linux讨论组]

一下是他的debug数据:

aljun@AljunPC:~/blogtest$ ssh -vT git@github.com
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.252.131] port 22.
debug1: Connection established.
debug1: identity file /home/aljun/.ssh/id_rsa type 1
debug1: identity file /home/aljun/.ssh/id_rsa-cert type -1
debug1: identity file /home/aljun/.ssh/id_dsa type -1
debug1: identity file /home/aljun/.ssh/id_dsa-cert type -1
debug1: identity file /home/aljun/.ssh/id_ecdsa type -1
debug1: identity file /home/aljun/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/aljun/.ssh/id_ed25519 type -1
debug1: identity file /home/aljun/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: RSA 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/aljun/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/aljun/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
Agent admitted failure to sign using the key.
debug1: Trying private key: /home/aljun/.ssh/id_dsa
debug1: Trying private key: /home/aljun/.ssh/id_ecdsa
debug1: Trying private key: /home/aljun/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
ringa_lee
ringa_lee

ringa_lee

全部回复(2)
大家讲道理
  1. 使用ssh-keygen -rsa -C "message",生成秘钥;
  2. 在/home/aljun/.ssh/下面找到id_rsa.pub和id_rsa;
  3. 复制id_rsa.pub中得内容,添加到github得SSH公钥去。
  4. 命令行运行, ssh git@github.com,会看到成功信息。
天蓬老师

亲试 已经解决了问题

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号