在 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
我以为你是说
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
请参阅gitolite 之类的程序如何工作?:
这个想法是始终使用 same 用户连接到 gitolite 服务器(在您的情况下,连接为 '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屋!