2013-08-29 89 views
2

我刚安装gitlab当遵循了这一官方指导价:https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md密码提示推本地主机(gitlab)git仓库

在同一台服务器,我安装的git(实验室),我试图做创建一个仓库以下内容:

 
su git (i started by logging in with the git user) 
cd /home/git/repositories 
mkdir test-project 
cd test-project 
git init 
touch README 
git add README 
git commit -m 'first commit' 
git remote add origin [email protected]:root/test-project.git 
git push -u origin master 

但是当我输入最后一行时,会提示用户输入密码[email protected]

另外,当我输入

ssh -T [email protected]
ssh -T [email protected]
时,我收到提示密码。

我一直在尝试加载可能的解决方案,写在互联网上但似乎没有工作。

感谢您的帮助提前。

+1

可能重复[GitLab需要git @ localhost密码才能推送到回购站点](http:// stackoverflow .com/questions/11767366/gitlab-requires-gitlocalhost-password-to-a-repo) –

回答

1

看起来这个用户在〜/ .ssh /(〜代表用户的主目录)中没有ssh私钥文件,名称为id_rsa,或者公钥没有被添加到gitlab中。

如果SSH密钥是在另一个位置,您可以创建一个名为config文件到〜/ .ssh/ 如何使用配置文件可以在这里阅读:http://nerderati.com/2011/03/simplify-your-life-with-an-ssh-config-file/

如果密钥存在,检查它的权限。它必须由用户拥有(在你的情况下:git)并且需要拥有权限(chmod)600

+0

感谢您的想法是解决方案。因为我在当地工作,所以我没想到我的用户需要ssh-key。添加一个键工作。 – Twoez