无法更改 vagrant 主文件夹中文件夹的权限 [英] Cannot change permissions of folders within vagrant home folder

查看:54
本文介绍了无法更改 vagrant 主文件夹中文件夹的权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我 ssh 进入我的 vagrant 虚拟机时,我可以更改 vagrant 用户文件夹上方和外部的文件和文件夹的权限,以及 vagrant 用户文件夹内的文件的权限.但无法更改 vagrant 用户文件夹下文件夹的权限.我是否以 vagrant 用户和 root 身份登录都有同样的问题.

When I ssh in to my vagrant vm, I can change permissions of files and folders above and outside the vagrant user folder, and for files within the vagrant user folder. But cannot change permissions for folders under the vagrant user folder. I have the same problem whether logged in as the vagrant user and root.

对于更改 vagrant 用户文件夹中的权限是否有某种限制?vagrant 用户文件夹不与主机操作系统共享,但 capistrano 部署文件夹和 docRoot 是.

Is there some sort of restriction on changing permissions in the vagrant user's folder? The vagrant user folder is not shared with the host OS, but the capistrano deploy folder and the docRoot are.

Guest 是 CentOS 6,Host 是 OS X 10.7.流浪者是 1.0.5.Virtualbox 是 4.2.1.

Guest is CentOS 6, Host is OS X 10.7. Vagrant is 1.0.5. Virtualbox is 4.2.1.

推荐答案

共享文件夹的格式会随着 Vagrant 的不同版本而变化.请参阅法比奥的回答 https://serverfault.com/questions/398414/vagrant-set-default-share-权限

The format for shared folders changes across different versions of Vagrant. See Fabio's answer https://serverfault.com/questions/398414/vagrant-set-default-share-permissions

config.vm.share_folder "v-data", "/export", "/export",:所有者=>'流浪汉',:组=>'httpd',:额外=>'dmode=775,fmode=775'

在 Vagrant 1.3.1 及更高版本中,extra 选项已替换为需要数组的 mount_options.

In Vagrant 1.3.1 and later, the extra option has been replaced with mount_options that expects an array.

config.vm.share_folder "v-data", "/export", "/export",:所有者=>'流浪汉',:组=>'httpd',:mount_options =>['dmode=775', 'fmode=775']

在 vagrant 1.3.3 中,似乎 config.vm.share_folder 已被替换为 config.vm.synced_folder.

In vagrant 1.3.3 it appears config.vm.share_folder has been replaced with config.vm.synced_folder.

config.vm.synced_folder "v-data", "/export", "/export",:所有者=>'流浪汉',:组=>'httpd',:mount_options =>['dmode=775', 'fmode=775']

这篇关于无法更改 vagrant 主文件夹中文件夹的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆