linux - 在Linux服务器上设置git

标签 linux authentication github redhat ssh-keys

我正在尝试在运行 Linux RedHat 的服务器上设置 git 存储库。

我按照 Github 帮助页面上的说明进行操作。我到达了指示告诉我通过 ssh 访问 git@github.com 的步骤。

这给了我以下错误 -

 $ ssh -T git@github.com
 Permission denied (publickey).

然后我做了 $ ssh -vT git@github.com 并得到了这个 -

 OpenSSH_5.3p1, OpenSSL 1.0.0-fips 29 Mar 2010
 debug1: Reading configuration data /home/min/a/foo/.ssh/config
 debug1: Applying options for *
 debug1: Reading configuration data /etc/ssh/ssh_config
 debug1: Applying options for *
 debug1: Connecting to github.com [some IP] port 22.
 debug1: Connection established.
 debug1: identity file /home/shay/a/foo/.ssh/id_rsa type -1
 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze1+github2
 debug1: match: OpenSSH_5.5p1 Debian-6+squeeze1+github2 pat OpenSSH*
 debug1: Enabling compatibility mode for protocol 2.0
 debug1: Local version string SSH-2.0-OpenSSH_5.3
 debug1: SSH2_MSG_KEXINIT sent
 debug1: SSH2_MSG_KEXINIT received
 debug1: kex: server->client aes128-ctr hmac-md5 none
 debug1: kex: client->server aes128-ctr hmac-md5 none
 debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
 debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
 debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
 debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
 debug1: Host 'github.com' is known and matches the RSA host key.
 debug1: Found key in /home/min/a/foo/.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: SSH2_MSG_SERVICE_REQUEST sent
 debug1: SSH2_MSG_SERVICE_ACCEPT received
 debug1: Authentications that can continue: publickey
 debug1: Next authentication method: publickey
 debug1: Trying private key: /home/shay/a/foo/.ssh/id_rsa
 debug1: No more authentication methods to try.
 Permission denied (publickey).

这就是我现在所在的位置 -

 $ pwd
 /home/min/a/foo/.ssh

我不明白这是怎么回事?另外,如果我尝试通过 ssh-add 添加此路径,它会显示“无法打开与您的身份验证代理的连接”。

最佳答案

您似乎尚未将 key 上传到 github,或者您上传的 key 与当前用户的默认 key 不匹配。

检查您的本地 key 是否在 github 上:

或者,检查您的 key 是否已在 github 上启用。不久前,有一个security issue related to ssh keys on github 。所有 ssh key 均被禁用,以强制用户检查其允许的 key 列表。如果您最近没有使用过 github,您的 github 仍可能被禁用。

关于linux - 在Linux服务器上设置git,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10553574/

相关文章:

Java : How setup an SSL One-Way authentification for a server-client over a LAN?

linux - Bash Grep 来自 Youtube 的观看次数

pythonnet dll 目录访问被拒绝

node.js - 使用node.js和mongoose以及expressjs和passportjs进行身份验证

http - Oauth 仅撤销访问 token

github - 从 github 项目分发二进制文件的最佳实践是什么?

eclipse - GitHub和Eclipse入门(spring源码工具包2.7.1)

git - pull 请求是 Git 的一部分,还是 GitHub、Gerrit 和 Atlassian Stash 等工具的一项功能?

c - Linux ps命令核心随机

linux - 一个单词一个单词地搜索整行