【发布时间】:2021-10-18 23:27:26
【问题描述】:
我正在尝试通过 hetzner deploy 上的 rails gemfile 从 github 获取 repo!但是在 ssh 中显示这个结果!
ssh -vT git@github.com
OpenSSH_7.6p1 Ubuntu-4ubuntu0.5, OpenSSL 1.0.2n 7 Dec 2017
debug1: Reading configuration data /home/dc/.ssh/config
debug1: /home/dc/.ssh/config line 1: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [140.82.121.3] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/dc~/.ssh/id_rsa.pub type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/dc~/.ssh/id_rsa.pub-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.5
debug1: Remote protocol version 2.0, remote software version babeld-322814ef
debug1: no match: babeld-322814ef
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
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:XXXXXxxxxxXXXXXXXXXXXX
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /home/dc/.ssh/known_hosts:16
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-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
git@github.com: Permission denied (publickey).
我已经尝试过一切 更改 PasswordAuthentication 是 在 /etc/ssh/sshd_config 上
在 known_hosts 和 authorized_keys 上添加了 keygen 在服务器和github上添加了keygen
创建一个 ed25519 密钥生成器并尝试一下
一切依旧
github 给我 git@github.com:权限被拒绝
.ssh/config 文件
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
Port 22
IdentityFile /home/dc~/.ssh/id_rsa.pub
【问题讨论】:
-
请edit 您的问题包含您的 .ssh/config 文件中的相关设置。从调试输出来看,您有一些影响连接过程的设置。
标签: github ssh cloud digital-ocean vps