在Centos 6.4上安装gitolite v3。第二个用户正在请求密码 [英] Install gitolite v3 on the Centos 6.4. The second user is asking a password
问题描述
请帮我明白我做错了什么。我有服务器在CentOS 6.4和我需要安装gitolite v3。我在做什么?我第一次使用下一个命令安装一个:
Please help me to understand what i am doing wrong. I have server on CentOS 6.4 and I need to install gitolite v3. What am i doing? by the first i am install one using next command:
yum install git* perl-Time-HiRes
useradd -m --system --shell /bin/bash --user-group gitolite
su - gitolite
mkdir bin
echo "PATH=$HOME/bin:$PATH" > .bash_profile
source .bash_profile
ssh-keygen -t rsa
cp .ssh/id_rsa.pub ./gitolite.pub
git clone git://github.com/sitaramc/gitolite
gitolite/install -ln
gitolite setup -pk gitolite.pub
安装成功。比我克隆gitolite-admin存储库:
Install was successful. Than I clone gitolite-admin repositories:
git clone gitadmin:gitolite-admin
cd gitolite-admin/keydir
并为新用户生成公钥(lodar.pub)
And generate public key for the new user(lodar.pub)
ssh-keygen -t rsa -f lodar
mv ./lodar ../../.ssh/lodar
比我编辑conf / gitolite.conf:
Than i edit conf/gitolite.conf:
repo gitolite-admin
RW+ = gitolite
repo testing
RW+ = @all
repo empty
RW+ = lodar
提交所有更改:
git add keydir/lodar.pub
git commit -m 'add user lodar and new repo empty'
git push
这就是全部。推送也成功了。所有操作后我创建了.ssh / config
And that is all. Push was successful too. After all manipulation i created .ssh/config
Host gitadmin
User gitolite
Hostname 192.168.0.1
Port 22
IdentityFile ~/.ssh/gitolite
Host gitlodar
User gitolite
Hostname 192.168.0.1
Port 22
IdentityFile ~/.ssh/lodar
但如果我尝试使用
ssh gitlodar info
lodar@192.168.0.1's password:
我必须输入密码。
ssh gitadmin info
hello, gitolite, this is gitolite@lodar-14452 running gitolite3 v3.5.1-4-g2f48a3e on git 1.7.1
R W gitolite-amdin
R W testing
我做错了什么?
推荐答案
您已:
mv ./lodar ../../.ssh/lodar
/ p>
I supposed you meant
cp ./lodar.pub ../../.ssh/
mv ./lodar ../../.ssh/
因为如果您不复制〜/ .ssh
,您将无法在ssh会话中使用它。
Because if you don't copy the public key in ~/.ssh
, you wouldn't be able to use it in an ssh session.
但另一个错误是在您的〜/ .ssh / config
文件:
But the other mistake is in your ~/.ssh/config
file:
Host gitlodar
User gitolite # not loadar!
Hostname 192.168.0.1
Port 22
IdentityFile ~/.ssh/lodar
$ b b
请参阅 gitolite之类的计划如何工作?:
想法是始终使用同一个用户连接到gitolite服务器(在您的情况下,连接为< $ c> gitolite '),并打开一个非交互式外壳。
force-command ssh行将调用gitolite脚本,并使用一个表示用户名的参数(这里' loadar
'),因为该名称是使用〜gitolite / .ssh / authorized_keys
。
See "How do programs like gitolite work?":
The idea is to always use the same user to connect to the gitolite server (in your case, connect as 'gitolite
'), and open an *non-interactive shell.
The force-command ssh line will call the gitolite script with a parameter representing the name of the user (here 'loadar
'), because that named is registered with the public key in the ~gitolite/.ssh/authorized_keys
.
这篇关于在Centos 6.4上安装gitolite v3。第二个用户正在请求密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!