Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
486 views
in Technique[技术] by (71.8m points)

centos - Cannot change permissions of folders within vagrant home folder

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.

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 is CentOS 6, Host is OS X 10.7. Vagrant is 1.0.5. Virtualbox is 4.2.1.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

Vagrant version 1.3.1 and earlier

config.vm.share_folder "v-data", "/export", "/export", :owner => 'vagrant', :group => 'httpd', :extra => 'dmode=775,fmode=775'

Vagrant version 1.3.1, 1.3.2

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", :owner => 'vagrant', :group => 'httpd', :mount_options => ['dmode=775', 'fmode=775']

Vagrant version >=1.3.3

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", :owner => 'vagrant', :group => 'httpd', :mount_options => ['dmode=775', 'fmode=775']


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...