Fix for vagrant keys permission issue

Note: This is an old post in a blog with a lot of posts over a long span of time. The world has changed, technologies have changed, and I've changed. It's likely this is out of date, the code doesn't work, the ideas haven't aged well, or the ideas were terrible to begin with. Let me know if you think this is something that needs updating.

Tim threw together a vagrant setup for Kitsune based on what Alex did in November. I went to give it a try but I'm using vagrant 0.8.10 and it died.

Important part of the error message was:

/var/lib/gems/1.8/gems/net-ssh-2.1.4/lib/net/ssh/key_factory.rb:38:in
`read': Permission denied - /var/lib/gems/1.8/gems/vagrant-0.8.10/keys/vagrant
(Errno::EACCES)

Issue is documented at https://github.com/mitchellh/vagrant/issues/235.

My fix was to do this:

saturn /var/lib/gems/1.8/gems/vagrant-0.8.10/keys> ls -al
total 24
drwxr-xr-x  2 root root 4096 Jan 11 20:00 .
drwxr-xr-x 10 root root 4096 Jan 11 20:00 ..
-rw-r--r--  1 root root  821 Jan 11 20:00 README.md
-rw-------  1 root root 1675 Jan 11 20:00 vagrant
-rw-r--r--  1 root root 1464 Jan 11 20:00 vagrant.ppk
-rw-r--r--  1 root root  409 Jan 11 20:00 vagrant.pub
saturn /var/lib/gems/1.8/gems/vagrant-0.8.10/keys> sudo chmod 644 vagrant
saturn /var/lib/gems/1.8/gems/vagrant-0.8.10/keys>

That fixed it for me. Figured I'd document it so that I could find it again when I bumped into it again.

Want to comment? Send an email to willkg at bluesock dot org. Include the url for the blog entry in your comment so I have some context as to what you're talking about.