oscar icon indicating copy to clipboard operation
oscar copied to clipboard

Add private keys from host

Open attiks opened this issue 13 years ago • 4 comments
trafficstars

Is there an easy way to add your own private keys, so we can push code to d.o.?

attiks avatar Aug 26 '12 10:08 attiks

Good question…I'd usually recommend agent-forwarding rather than adding the keys to the box (because I know plenty of people who have simply zipped a box up to copy to someone else's machine, and no-one wants to hand out their private keys), but I can see value in both.

I'll experiment a little to work out:

  • the best way of specifying keys to copy (I know some builds that lift all the dot-files in ~, and the ~/.ssh dir)
  • how to handle agent-forwarding in vagrant ssh

manarth avatar Aug 26 '12 10:08 manarth

Someone mentioned this at Drupalcon Munich, and a good solution, I'll try to remember what it was!

darthsteven avatar Sep 29 '12 10:09 darthsteven

I think that this was it: https://github.com/myplanetdigital/ariadne/blob/master/cookbooks-override/ariadne/libraries/helpers.rb

But it looks like vagrant has baked in support for ssh agent-forwarding: http://vagrantup.com/v1/docs/config/ssh/forward_agent.html

darthsteven avatar Sep 29 '12 11:09 darthsteven

Indeed the option in Vagrant works, for the vagrant user in the VM, and adding this line to the /etc/sudoers file makes that work for the root (and presumably other users too)

Defaults env_keep = "SSH_AUTH_SOCK"

darthsteven avatar Sep 29 '12 11:09 darthsteven