From 8cca8535e705dff1d72f68f39980de8bc24220eb Mon Sep 17 00:00:00 2001 From: Nitzan Raz Date: Mon, 25 Aug 2014 12:55:42 +0300 Subject: [PATCH] Ignoring SSHKeyBadOwner if user is root (uid 0) Allows using `sudo vagrant up` without `chown`ing the insecure private key --- lib/vagrant/util/ssh.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant/util/ssh.rb b/lib/vagrant/util/ssh.rb index a13314a62..c3da32c52 100644 --- a/lib/vagrant/util/ssh.rb +++ b/lib/vagrant/util/ssh.rb @@ -33,7 +33,7 @@ module Vagrant LOGGER.debug("Checking key permissions: #{key_path}") stat = key_path.stat - if !stat.owned? + if !(stat.owned? || (Process.uid == 0)) # The SSH key must be owned by ourselves raise Errors::SSHKeyBadOwner, key_path: key_path end