gpt4 book ai didi

gitolite - 使用 gitolite 时要求用户输入密码

转载 作者:行者123 更新时间:2023-12-02 22:10:30 29 4
gpt4 key购买 nike

我已成功创建gitolite-admin.git服务器上的存储库(例如)10.107.105.13 。我可以在本地计算机上克隆此存储库(例如)10.14.42.7通过发布 git clone gitolite@10.107.105.13:gitolite-admin 。我必须在.ssh/config中添加一些行文件以确保使用正确的私钥。

然后我添加了一个用户dilawarconf/gitolite.conf文件和适当的 key dilawar.pubkeys文件夹。我已将此提交添加并提交到 gitolite-admin repo 。我还在 .ssh/conf 中又添加了一个条目文件以便使用正确的私钥。但是当我尝试做git clone dilawar@10.107.105.13:testing时,gitolite 要求输入密码。我的印象是我不必在 10.107.105.13 上创建用户 dilawar。我通过登录服务器检查了存储库testing.git是否存在以及公钥dilawar.pub已添加至.ssh/authorized_keys

我也尝试过ssh -vvvv dilawar@10.107.105.13检查是否提供了正确的文件。这是我的.ssh/conf文件。

HostName 10.107.105.13 
User gitolite
IdentityFile ~/.ssh/gitolite

Host 10.107.105.13
HostName 10.107.105.13
User dilawar
IdentityFile ~/.ssh/id_rsa

我做错了什么?

最佳答案

在你的配置文件中,我看到:

User dilawar

这是错误的。与 gitolite 服务器的 ssh 通信始终使用同一帐户(此处为 gitolite)完成。
变化的是使用的私钥,这将有助于 gitolite 确定您的身份。

您的~/.ssh/config 文件应如下所示:

Host admin
HostName 10.107.105.13
User gitolite
IdentityFile ~/.ssh/gitolite

Host dilawar
HostName 10.107.105.13
User gitolite
IdentityFile ~/.ssh/id_rsa

要克隆gitolite-admin,您可以使用:

git clone admin:gitolite-admin

对于克隆存储库,dilawar 可以访问:

git clone dilawar:aRepo

查看更多信息“Gitolite: adding user not working, and DENIED by fallthru when cloning as root?”。
另请参阅“how gitolite uses ssh

Adding your public key to the server's ~git/.ssh/authorized_keys file is how ssh uses pubkeys to authenticate users.
Let's say sita@work.station is trying to log in as git@server.
What you have to do is take the ~sita/.ssh/id_rsa.pub file for user sita on work-station and append its contents (remember it's only one line) to ~git/.ssh/authorized_keys for user git on server.

The authorized_keys file can have multiple public keys (from many different people) added to it so any of them can log in to git@server.

关于gitolite - 使用 gitolite 时要求用户输入密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10906633/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com