【问题标题】:vagrant synced_folder file permissionsvagrant synced_folder 文件权限
【发布时间】:2014-11-17 22:34:44
【问题描述】:

流浪者版本 1.6.3

虚拟盒子 4.3.12

VBoxGuestAdditions-4.3.2

主机操作系统 -> Windows 8

来宾操作系统 -> CentOS 6.4

这是我的 Vagrantfile 的内容(其中 developer 是 userName )

config.vm.synced_folder ".", "/vagrant", disabled: true

config.vm.synced_folder ".", "/var/www"

#  # comments-> I tried many combinations
# :owner=> 'developer',
# :group=> 'developer'
# :mount_options=> ['dmode=777', 'fmode=777']

现在当我尝试通过 chmod 命令更改 synced_folder(/var/www) 或 synced_folder 的子目录或文件的访问权限时,结果与预期不符

例如

1) vim testFile.php 

2) ls -al testFile.php
   -rwxrwxrwx 1 developer developer 12 Sep 23 15:52 testFile.php

3) chmod 700 testFile.php
   -rwxrwxrwx   1 developer developer        12 Sep 23 15:52 testFile.php

4) chmod 000 testFile.php
   -r-xr-xr-x   1 developer developer        12 Sep 23 15:52 testFile.php

5) chmod 111 testFile.php
   -r-xr-xr-x   1 developer developer        12 Sep 23 15:52 testFile.php

6) chmod 077 testFile.php
   -rwxrwxrwx   1 developer developer        12 Sep 23 15:52 testFile.php

基本上,“所有者”、“组”和“其他人”始终可以读取和执行该文件。 问题是为什么会这样?有什么解决办法吗?我希望 synced_folder 的行为符合 centOS 访问权限。

过去几天我真的被困在这里。请帮忙。

谢谢

【问题讨论】:

    标签: centos vagrant file-permissions chmod


    【解决方案1】:

    客户操作系统通常会保留主机的权限。尝试在 Windows 上为其他用户添加权限。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-07
      • 2016-06-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多