vagrant setup在克隆git时抛出权限被拒绝(publickey)

时间:2015-10-08 08:24:48

标签: git ubuntu vagrant

我正在尝试在vagrant setup的客户端上运行Vagrantfile,将他的木偶项目设置到我的开发环境中,我以前从未使用或听说过Vagrant,

它会引发以下错误

REPO: /var/www/project/project-puppet/deploy/vagrant/hiera/common
SETUP: Cloning ssh://git@source.sanoma.com:7999/devops/hiera-common.git 
Cloning into '/var/www/project/project-puppet/deploy/vagrant/hiera/common'... 
Permission denied (publickey). 
fatal: Could not read from remote repository.

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

There was an error loading a Vagrantfile. The file being loaded
and the error message are shown below. This is usually caused by
a syntax error.

Path: /var/www/project/project-puppet/Vagrantfile
Line number: 113
Message: Errno::ENOENT: No such file or directory - /var/www/project/project-puppet/deploy/vagrant/hiera/common

P.S:我正在使用Ubuntu 15.04

和Vagrant 1.7.4

2 个答案:

答案 0 :(得分:1)

首先,你有拉动许可吗? 如果是,您是否设置了ssh密钥以通过ssh连接访问此repo?如果没有,请进行设置。

github上用于设置ssh访问的指南。 (类似于不同的git主机)

ssh key generation

答案 1 :(得分:0)

您似乎无权访问远程存储库,因为它无法识别/找到您的SSH密钥。您应该有~/.ssh/id_rsa.pub~/.ssh/id_dsa.pub等文件。

如果不这样做,您可以通过从控制台运行ssh-keygen -t rsa来创建新密钥。只需按照步骤操作,您的homedir就会得到一个.ssh/id_rsa.pub文件。

确保您的客户端获取该公钥(发送您的私钥(id_rsa文件),这仅供您使用/查看)。一旦他们拥有它并允许它访问存储库,您应该能够克隆它。