0

I am trying to get vagrant to clone a Stash repo at the end of the provision phase of a vagrant up

During a vagrant up I currently receive the following error:

   default: Running: inline script
==> default: Cloning into 'awesome_repo'...
==> default: Permission denied (publickey).
==> default: fatal: Could not read from remote repository.
==> default: 
==> default: Please make sure you have the correct access rights
==> default: and the repository exists.

I have set my project to use vagrant's public and private key: config.ssh.insert_key = false

I have placed the insecure_private_key file in the ~/.ssh/ folder on the guest machine. And I have placed the vagrant public key into my Stash Repo.

For some reason when I get to that stage in the provisioner I receive the above error. I have also tried these steps by vagrant ssh into the guest machine then proceeding to git clone and I am receiving the same error.

Here is part of my Vagrantfile SSH configurations:

  config.ssh.insert_key = false
  config.ssh.pty = true

I'm not sure what I am doing wrong. Any clues?

adbarads
  • 1,253
  • 2
  • 20
  • 43

1 Answers1

0

since you didn't paste the whole Vagrantfile, but let me guess, you should use https:// than git:// to clone the repository.

BMW
  • 42,880
  • 12
  • 99
  • 116
  • why should I use https? that would request my username and password instead of using the ssh public / private key for authentication. I wouldn't be able to automate cloning the repo. – adbarads Jan 20 '16 at 04:29
  • try first, just save your time, if you don't like my solution, then fight with the problem :-) otherwise, paste all in Vagrantfile for us to refer. – BMW Jan 20 '16 at 04:46