Hetzner Error: Permission denied (publickey)



我试图从github通过rails gemfile在hetzner部署!但是在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 keygen并尝试它

everything and still

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

从hetzner专用服务器,您首先需要检查的是:

ssh -Tv git@github.com

只要你不看到"Welcome"消息,任何其他进程(假设它在该服务器上使用相同的用户帐户执行)将无法使用SSH从GitHub获取。

相关内容

  • 没有找到相关文章

最新更新