gitosis要求输入密码 [英] gitosis asking for password
问题描述
我已经按照此处。它适用于初始用户,但我最近添加了新用户。这是我采取的步骤。
I have setup a gitosis server following instructions from here. It works fine for the initial user but I have recently added a new user. Here are the steps I took.
- 使用
ssh-keygen
创建rsa密钥对,与文件名johndoe。 - 然后将其复制到gitosis管理库中的keydir。
- 编辑gitosis配置文件并将用户johndoe添加到成员
- 使用
git commit -a -m我做了什么提交了更改
- 将更改推送到服务器上
- Created an rsa keypair using
ssh-keygen
with filename johndoe. - Then copied it to the keydir in gitosis admin repo.
- Edited the gitosis config file and added user johndoe to the list of members
- Commited the changes using
git commit -a -m "what i did"
- Pushed the changes to the server
之后,我尝试使用新的密钥文件签出。它要求密码,当我输入正确的时候,它要求输入用户密码的密码!
用户git没有密码。
After that I tried to check out with the new keyfile. It asks for the passphrase and when I enter it correctly, it the asks for the password for user git!!! There is not password for user git.
现在我已经在sshd_config中关闭了PasswordAuthentication,现在它显示'Permission denied(publickey)'。我已经检查了git用户的authorized_keys文件,并且只有一个密钥在它内部被授权,即gitosis admin的初始密钥。
Now I have turned off PasswordAuthentication in sshd_config and now it says 'Permission denied (publickey). I have checked the git user's authorized_keys file and only one key is authorized inside it, i.e. the initial key for the gitosis admin.
我还检查了./gitosis-admin.git/hooks/post-update钩子,它有755
I have also double checked the permissions on the ./gitosis-admin.git/hooks/post-update hook and it has 755
推荐答案
Gitosis是一种愚蠢 - 是您使用的密钥文件的文件名字面上是johndoe?如果是这样,请改变:
Gitosis is kind of stupid — is the filename you used for the keyfile literally "johndoe"? If so, change that:
git mv keydir/johndoe keydir/johndoe.pub
git commit -m "changed key name"
git push
然后重试。
此外,正如Arlen Cuss指出的那样,确保它实际上是是公钥,而不是私钥。
Also, as Arlen Cuss points out, make sure it actually is the public key, not the private key.
这篇关于gitosis要求输入密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!