chmod 777 到文件夹和所有内容
我有一个 Web 目录 /www
以及该目录中一个名为 store
的文件夹。
store
内有几个文件和文件夹。我想授予文件夹 store
以及 store
文件夹中的所有文件和文件夹所有权限。
我该怎么做?我猜是通过.htaccess。
I have a web directory /www
and a folder in that directory called store
.
Within store
are several files and folders. I want to give the folder store
and all files and folders within the store
folder all permissions.
How do I do this? I am guessing via .htaccess.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
如果您要使用控制台命令,则为:
chmod -R 777 /www/store
。-R
(或--recursive
)选项使其递归。或者,如果您想让当前目录中的所有文件具有所有权限,请输入:
chmod -R 777 ./
如果您需要有关
chmod
命令的更多信息,请参阅:文件权限If you are going for a console command it would be:
chmod -R 777 /www/store
. The-R
(or--recursive
) options make it recursive.Or if you want to make all the files in the current directory have all permissions type:
chmod -R 777 ./
If you need more info about
chmod
command see: File permission如果您所说的所有权限是指 777
导航到文件夹并
If by all permissions you mean 777
Navigate to folder and
您可以使用选项
-R
授予文件夹及其所有内容的权限,即递归权限。但我建议不要授予所有文件夹及其所有内容的 777 权限。您应该为 www 目录文件夹中的每个子文件夹授予特定权限。
出于安全原因,最好为 Web 文件夹授予
755
权限。每个数字在许可中都有意义。不要给予完全许可。
如果您的生产 Web 文件夹有多个用户,那么您可以相应地设置权限和用户组。
更多信息:
You can give permission to folder and all its contents using option
-R
i.e Recursive permissions.But I would suggest not to give 777 permission to all folder and it's all contents. You should give specific permission to each sub-folder in www directory folders.
Ideally, give
755
permission for security reasons to the web folder.Each number has meaning in permission. Do not give full permission.
If your production web folder has multiple users, then you can set permissions and user groups accordingly.
More info :
您还可以使用
chmod 777 *
这将授予文件夹中当前所有文件以及将来添加的文件的权限,而不授予目录本身的权限。
注意:这应该在文件所在的文件夹中完成。对我来说,这是一个有问题的图像,所以我转到我的图像文件夹并执行了此操作。
You can also use
chmod 777 *
This will give permissions to all files currently in the folder and files added in the future without giving permissions to the directory itself.
NOTE: This should be done in the folder where the files are located. For me it was an images that had an issue so I went to my images folder and did this.
是的,非常正确,
chmod
命令中的-R
选项使给定目录下的文件/子目录将获得777权限。但一般来说,为所有文件和目录提供 777 并不是一个好的做法,因为它可能会导致数据不安全。尝试非常具体地授予所有文件和目录的所有权限。并回答你的问题:...会起作用
Yes, very right that the
-R
option inchmod
command makes the files/sub-directories under the given directory will get 777 permission. But generally, it's not a good practice to give 777 to all files and dirs as it can lead to data insecurity. Try to be very specific on giving all rights to all files and directories. And to answer your question:... will work
对于 Mac,应该是“超级用户执行的操作”;
所以首先:
然后
for mac, should be a ‘superuser do’;
so first :
and then
这对我不起作用。
我也使用了
-f
。This didn't work for me.
I used
-f
also.