oscar
oscar copied to clipboard
Add private keys from host
Is there an easy way to add your own private keys, so we can push code to d.o.?
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~/.sshdir) - how to handle agent-forwarding in
vagrant ssh
Someone mentioned this at Drupalcon Munich, and a good solution, I'll try to remember what it was!
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
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"