Macos 流浪汉应该为每个命令要求sudo吗?

Macos 流浪汉应该为每个命令要求sudo吗?,macos,permissions,vagrant,sudo,chown,Macos,Permissions,Vagrant,Sudo,Chown,简言之,我的问题是:每次执行任何没有“sudo”的Vagrant命令时,我都会遇到权限错误,从Vagrant up到Vagrant provision。这是预期的行为吗 /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `unlink': Permission denied - /Users/Cibulka/Sites/.vagrant/machines/default/vir

简言之,我的问题是:每次执行任何没有“sudo”的Vagrant命令时,我都会遇到权限错误,从
Vagrant up
Vagrant provision
。这是预期的行为吗

/Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `unlink': Permission denied - /Users/Cibulka/Sites/.vagrant/machines/default/virtualbox/id (Errno::EACCES)
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `delete'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:295:in `id='
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:438:in `state'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/created.rb:11:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/call.rb:43:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/warden.rb:34:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/builder.rb:116:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `block in run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/util/busy.rb:19:in `busy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/action/runner.rb:66:in `run'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:196:in `action_raw'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:173:in `block in action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:434:in `lock'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `call'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/machine.rb:161:in `action'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/provision/command.rb:35:in `block in execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/plugin/v2/command.rb:220:in `each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/plugins/commands/provision/command.rb:34:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/cli.rb:42:in `execute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.6.3/lib/vagrant/environment.rb:252:in `cli'
from /Applications/Vagrant/bin/../embedded/gems/gems/vagrant-1.6.3/bin/vagrant:166:in `<main>'
。。。我的流浪汉的行为似乎更为稳定


这只是一个旁注,为我的问题提供了一些(相当本地化的)上下文,所以如果它没有提供任何值,请随意编辑/删除它。

我做了我的第一个
vagrant up
,作为我自己安装脚本的一部分,作为
sudo
运行。因此,安装的每个文件都属于
root
用户,而不是我的当前帐户

相关的:

简而言之,当您遇到类似问题时,您总是可以“收回”相关文件的所有权

chown -R <USERNAME> /<YOUR-WEBSITES-DIRECTORY>/.vagrant/machines/

chown -R <USERNAME> /<YOUR-HOME-DIRECTORY>/.vagrant.d
chown-R//.流浪汉/机器/
chown-R//流浪汉d

vagrant up
和其他命令从现在起应该可以在没有sudo的情况下工作。

对我来说非常有用:D在Laravel Homestead的情况下:
sudo chown-R elporfirio.homestad/
然后在Homestead文件夹中,在我的情况下是
usr/elporfirio/VMS/homestad
chown -R <USERNAME> /<YOUR-WEBSITES-DIRECTORY>/.vagrant/machines/

chown -R <USERNAME> /<YOUR-HOME-DIRECTORY>/.vagrant.d