Ignoring SSHKeyBadOwner if user is root (uid 0)

Allows using `sudo vagrant up` without `chown`ing the insecure private key
This commit is contained in:
Nitzan Raz 2014-08-25 12:55:42 +03:00
parent 0ebb57b888
commit 8cca8535e7
1 changed files with 1 additions and 1 deletions

View File

@ -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