【发布时间】:2018-06-18 14:36:00
【问题描述】:
我的 Gitea 版本是 1.2.3,它安装在 gentoo 专用服务器上。 我使用我的用户(不是 root 用户)在另一台专用服务器上创建了我的 SSH 密钥。
在 Gitea GUI 上,我为该组织创建了一个组织和一个 repo,我的 gitea 用户是所有这些的所有者(不是 root 帐户)
当我转到 [Organization]/[MyRepo] > 设置 > 部署密钥时,我添加了远程用户的 ssh 密钥。 Gitea 将该密钥添加到 .ssh git 用户中的 authorized_key 文件中(git 用户是 gitea 的用户)
从我的遥控器,当我尝试这样做时:
ssh git@[gitea_server_ip]
我收到了这条消息:
Hi there, You've successfully authenticated, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
所以 SSH 工作得很好,但是当我尝试推送或克隆时,我明白了:
git push -u origin master
答案:
Gitea: Key permission denied
Cannot push with deployment key: 5
fatal: Could not read from remote repository
Please make sure you have the correct access rights and the repository exists.
这似乎是一个gitea认证问题,但我没有找到答案,谢谢。
【问题讨论】:
-
AFAIU 用于推送的 ssh 密钥必须是用户密钥,而不是部署密钥。见github.com/go-gitea/gitea/issues/938
-
好的,我应该使用什么?因为我使用远程用户生成了密钥并将其用于部署密钥,所以这是错误的方式吗?感谢您的帮助
-
在你告诉我要做的事情中,除了“重新配置 ssh 以使用其私钥连接到服务器”部分之外,我已经做了所有这些,你的意思是什么?因为我不能把私钥给其他服务器,不是吗?
-
您现在有 2 个 ssh 密钥对——用户密钥和部署密钥。您需要configure ssh 以允许 git 使用其中一个。当然你不会公开你的私钥。
标签: git authentication ssh gitea