4

In order to bundle and connect to Github as my normal self within my VM, I'd like to config.vm.share_folder "ssh", "/home/vagrant/.ssh", "~/.ssh".

Except this breaks vagrant's public/private key authentication.

Attempted Solution #1

I tried to copy my public key to also be authorized_keys. Same behavior; I need to enter a password to vagrant ssh.

Attempted Solution #2

Copy the public key to authorized_keys, but also set config.ssh.private_key_path = "~/.ssh/id_dsa". This just screwed everything up, though.

chadoh
  • 4,343
  • 6
  • 39
  • 64

1 Answers1

7

I think what you want to look into is SSH agent forwarding. Vagrant has a configuration option to enable this. If you are already running an SSH agent locally this is definitely the way to go.

In fact, even if you aren't running an SSH agent, I would still suggest looking into it.

An alternate, but horribly dirty, solution might be to use a vagrant shell provisioner to place your private key in ~/.ssh/ and set the relevant entries in ~/.ssh/config. Something like:

Host *
    IdentityFile ~/.ssh/my_non_vagrant_key
nickrw
  • 166
  • 2