【发布时间】:2020-03-24 06:04:31
【问题描述】:
我正在尝试使用 ssh 协议连接到远程 github 存储库。
之后
git remote add origin ssh://username@github.com/foo/project.git
git 远程显示来源
产量:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
ssh -vT git@github.com 日志:
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /home/inna/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [999.99.999.9] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/inna/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
debug1: Remote protocol version 2.0, remote software version babeld-0de80d89
debug1: no match: babeld-0de80d89
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: rsa-sha2-512
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:hhgkhkjhjkhjkhjkhjkhjkhkjhjkhjkhjk
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/inna/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,rsa-sha2-512,rsa-sha2-256,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/inna/.ssh/jj
debug1: Server accepts key: pkalg ssh-rsa blen 535
debug1: Authentication succeeded (publickey).
Authenticated to github.com ([999.99.999.9]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
debug1: Sending environment.
debug1: Sending env LC_PAPER = ru_RU.UTF-8
debug1: Sending env LC_ADDRESS = ru_RU.UTF-8
debug1: Sending env LC_MONETARY = ru_RU.UTF-8
debug1: Sending env LC_NUMERIC = ru_RU.UTF-8
debug1: Sending env LC_TELEPHONE = ru_RU.UTF-8
debug1: Sending env LC_IDENTIFICATION = ru_RU.UTF-8
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending env LC_MEASUREMENT = ru_RU.UTF-8
debug1: Sending env LC_TIME = ru_RU.UTF-8
debug1: Sending env LC_NAME = ru_RU.UTF-8
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi Inna! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 3888, received 2484 bytes, in 0.3 seconds
Bytes per second: sent 11319.0, received 7231.6
debug1: Exit status 1
到同一个项目的 https 连接工作得很好,但我每次访问远程存储库时都必须登录(顺便问一下,我能以某种方式包抄它吗?)。
SSH 密钥存在并且用户可以访问它们。
谁能告诉我是什么问题?
【问题讨论】: