www数据的权限? [英] www-data permissions?

查看:162
本文介绍了www数据的权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在/ var / WWW(称为饼)的目录,我需要允许www数据写入到它,但我也想写信给它(还没有使用sudo)。我怕的权限更改为777的情况下,我的机器上一些其他的用户(或黑客)试图在该目录中修改文件。我怎么只允许自己和Apache的www数据访问?


解决方案

 须藤CHOWN -R提供yourname:www数据饼

然后

  sudo的搭配chmod -R摹+ S蛋糕

第一个命令改变所有者和组
第二个命令添加小号属性这将让新文件和目录蛋糕内具有同一组权限

So I have a directory in /var/www (called cake) and I need to allow www-data to write to it, but I also want to write to it (without having to use sudo). I'm afraid to change the permissions to 777 in case some other user on my machine (or a hacker) attempts to modify files in that directory. How do I only allow access for myself and Apache's www-data?

解决方案

sudo chown -R yourname:www-data cake

then

sudo chmod -R g+s cake

First command changes owner and group Second command adds s attribute which will keep new files and directories within cake having the same group permissions

这篇关于www数据的权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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