Don Flannagan
Don Flannagan

Reputation: 583

Varying Vagrant Vagrants - How to copy site files from private bitbucket repository

I am trying to use my own custom site template provisioner which uses a private bitbucket repository. I am using a Windows 10 host machine. My config.yml file has this:

  mysite:
    repo: https://[email protected]/myrepo/vvv_template_mysite.git
    description: "My Site"
    skip_provisioning: false
    hosts:
      - mysite.test

But I get this error:

default: fatal: could not read Password for 'https://[email protected]': No such device or address

I have SSH keys on both the host machine and the VM which should let it connect to bitbucket without a password.

I also added a config file which contains:

Host bitbucket.org
  IdentityFile ~/.ssh/id_rsa

But it still gives the same error. Changing the https address to an SSH address:

[email protected]/myuser/myrepo.git

changes the error message to:

default: [email protected]: Permission denied (publickey).

Setting up SSH key forwarding by adding the ~/.ssh/id_rsa key to ssh-agent does not work either.

Another thing I tried is:

What worked is:

  1. Install Putty
  2. Creating a new key pair with Putty
  3. Upload Putty public key to Bitbucket
  4. Add Putty private key to Pageant

Weirdly enough this worked the first time I tried it, but now every time I try to use these putty keys for anything it tells me the ppk key is invalid format.

EDIT: Eventually I figured out that I can import my ordinary OpenSSH key (id_rsa) into PuTTy and generate a .ppk key from that, then I can use plink like this:

$ C:/Program\ Files/PuTTy/plink.exe -T [email protected]
Using username "git".
Access granted. Press Return to begin session.

But now the problem I have is I need to make plink.exe the default SSH executable (what runs when git bash runs the ssh command), I read that you can do this by setting the GIT_SSH environment variable to point to plink. I tried this but it doesn't work.

Why am I wasting a huge amount of time on this bs? Oh yeah, it's because I got a new laptop which came with Windows 10 installed on it and I thought "ah, since it's already installed on there I might as well use it, I can always run Linux and launch my development environments with vagrant). I should have known better. This is like a recurring nightmare and the only way to wake up is to install Linux. It's like an episode of Black Mirror where Windows has taken over the world and installed this horrific operating system on every single new laptop that comes out of a factory and brainwashed the masses into believing it is actually in their best interest to use this operating system which imprisons them technologically, economically and even mentally. They never asked me if I wanted Windows on my new laptop.I was not asked for my consent, they just went ahead and did it. I feel like I've been violated. And it's not the first time. I once got a new laptop and it had a weird UEFI booting mechanism that actually prevented you from installing another operating system. I was stuck with Windows for a long time. This is like being stuck in a prison cell with a cell mate who...

Upvotes: 0

Views: 178

Answers (1)

Don Flannagan
Don Flannagan

Reputation: 583

It works now. So one of the problems was that I had this in my config file:

Host bitbucket.org
  IdentityFile ~/.ssh/id_rsa.ppk

Git bash can't read the .ppk format so wasn't importing them. I removed that from the config file and it works now. I'm a bit confused because bitbucket says that the .ppk has never been used, but the OpenSSH (id_rsa) key is being used regularly: [enter image description here][1]

If Pageant is turned if, it does NOT work, it can't authenticate with bitbucket. But with Pageant turned on, it works. [1]: https://i.sstatic.net/AkfHx.png

Upvotes: 0

Related Questions