简体   繁体   English

无法在同一个远程ubuntu服务器上克隆gitolite的git repo

[英]Can't clone git repo from gitolite on the same remote ubuntu server

I have gitolite on the remote ubuntu 16 server that keeps also production environment (nginx server and release version of web projects). 我在远程ubuntu 16服务器上有gitolite,它还保留了生产环境(nginx服务器和web项目的发布版本)。

Gitolite keeps common access project repository. Gitolite保留了通用访问项目存储库。 Development process is on the local machines. 开发过程在本地机器上。 A lot of successful pushes to gitolite project repository. 很多成功的推动到gitolite项目存储库。

Now i'm going to deploy (clone) git project from gitolite to /var/www/project directory on the same remote ubuntu server. 现在我将从gitolite部署(克隆)git项目到同一个远程ubuntu服务器上的/ var / www / project目录。

To do that I've: 要做到这一点,我有:

  1. connected to the server via ssh under my regular user with sudo permission (not git user) 通过ssh在我的常规用户下使用sudo权限(不是git用户)连接到服务器
  2. generated rsa.pub ssh-keygen -t rsa 生成rsa.pub ssh-keygen -t rsa
  3. copied rsa.pub to the keydir on the local machine with gitolite admin permissions as git-serveruser.pub 将rsa.pub复制到本地计算机上的keydir,使用gitolite admin权限作为git-serveruser.pub
  4. changed gitolite.conf 改变了gitolite.conf

    repo repositoryname RW+ = git-admin git-serveruser

  5. commited and pushed changes to the server 提交并推送更改到服务器

Then i've tried to clone repository with following ssh command: 然后我尝试使用以下ssh命令克隆存储库:

git clone git@localhost:repositoryname

Unfortunately i've got this permission error: 不幸的是我收到了这个权限错误:

Cloning into 'repositoryname'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

There is default testing repository with @all +RW permissions. 有@all + RW权限的默认测试存储库。 So've tried this one 所以试过这个

git clone git@localhost:testing

and got the same error... 并得到同样的错误......

Is't possible to clone repository from gitolite on the same remote machine? 是否有可能在同一台远程计算机上从gitolite克隆存储库? What i'm doing wrong? 我做错了什么? How can i solve this problem? 我怎么解决这个问题?

Just to be sure, try with 只是为了确定,试试吧

GIT_SSH_COMMAND='ssh -i /full/path/to/.ssh/id_rsa' git clone git@localhost:repositoryname

If it fails, double check the ssh troubleshooting , in particular check that your public key does end up in ~git/.ssh/authorized_keys 如果失败,请仔细检查ssh故障排除 ,特别检查您的公钥是否最终在~git/.ssh/authorized_keys

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM