vagrant setup throws Permission denied (publickey) when cloning git
I’m trying to run
vagrant setup on clients given
Vagrantfile to setup his puppet project into my development environment, I’ve never used or heard about Vagrant before,
its throws the following errors
REPO: /var/www/project/project-puppet/deploy/vagrant/hiera/common SETUP: Cloning ssh://firstname.lastname@example.org: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: I’m using Ubuntu 15.04
And Vagrant 1.7.4
2 Solutions collect form web for “vagrant setup throws Permission denied (publickey) when cloning git”
First, do you have pull permission?
If yes, have you set up your ssh key for access to this repo via an ssh connection? If not, set it up.
A guide on github for setting up for ssh access. (Similar for different git hosts)
ssh key generation
You don’t seem to have access to the remote repository because it doesn’t recognise/find your SSH key. You should have a file like
If you don’t, you can create a new key by running
ssh-keygen -t rsa from a console. Just follow the steps and you should end up with a
.ssh/id_rsa.pub file in your homedir.
Make sure your client gets that public key (do not send your private key (
id_rsa file), that’s only for you to use/see). Once they have it and allow it access to the repository, you should be able to clone it.