4

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://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: I'm using Ubuntu 15.04

And Vagrant 1.7.4

riksof-zeeshan
  • 511
  • 8
  • 23
  • `setup` is not a recognized option for `vagrant` - you might want to tell which version you're using (`vagrant version`) and plugin if any (specially the one that provides this new option) you can run `vagrant plugin list` also sharing your Vagrantfile might help others to support you – Frederic Henri Oct 08 '15 at 08:31
  • from the vm, can you do `git clone ssh://git@source.sanoma.com:7999/devops/hiera-common.git` - if you have the same error, there are plenty of articles which discussed this issue – Frederic Henri Oct 08 '15 at 08:39
  • You don't seem to have read access to the remote repository. Ask your client to allow you to access it. They will need your public SSH key for this (can usually be found under `.ssh/id_rsa.pub` or `.ssh/id_dsa.pub` in your home directory. – Oldskool Oct 08 '15 at 08:54
  • @Oldskool actually I dont have keys, they say `do you have defined your SSH key in your profile?` so I think this will solve the issue – riksof-zeeshan Oct 08 '15 at 09:51
  • @riksof-zeeshan Seems like the problem then, yeah. I added an answer below with more details. – Oldskool Oct 08 '15 at 10:08

2 Answers2

1

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

Kaiwen Huang
  • 786
  • 1
  • 5
  • 11
  • riksof, you need to add the whole chunk of your public key generated into your account profile on whichever git host it is. Ensure that your profile has the correct public ssh key. Most git hosting sites have an ssh key generation guide. If you're sure the SSH is done correctly and you still have the same problem, it's likely to be some other authentication issue. Refer to this for a similar situation http://stackoverflow.com/questions/18551556/permission-denied-publickey-when-ssh-access-to-amazon-ec2-instance – Kaiwen Huang Oct 08 '15 at 17:48
0

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 ~/.ssh/id_rsa.pub or ~/.ssh/id_dsa.pub.

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.

Oldskool
  • 32,791
  • 7
  • 50
  • 64
  • Well I have added the pub key to the git myself, since I had write permissions, But I still have the same problem. – riksof-zeeshan Oct 08 '15 at 10:16
  • note: for me, i actually had to log out and log back in to 'help' find the new generated keys for in the vagrant user's profile (aka a 'vagrant reload') – armyofda12mnkeys Aug 07 '18 at 15:22