Many of my php scripts have got 644 permission and I would prefer that to be set to 400 so that other users on the system can't access them unless called by webserver. Is it possible to set any file system acl to achieve this without fiddling with apache/php/suphp?
我的许多php脚本都获得了644权限,我希望将其设置为400,这样系统上的其他用户除非被webserver调用,否则无法访问它们。是否可以设置任何文件系统acl来实现这一点,而无需摆弄apache / php / suphp?
2 个解决方案
#1
0
If you're talking about setting file permissions in Linux:
如果你在谈论在Linux中设置文件权限:
chmod 400 filename
#2
0
ACL's is, what you are looking for. by using ACL's you can set very granular restrictive access rules and also keep access for service users, like wwwrun and so on. It is important, that your filesystem supports ACL's.
ACL是,你在寻找什么。通过使用ACL,您可以设置非常精细的限制性访问规则,并保持对服务用户的访问,如wwwrun等。重要的是,您的文件系统支持ACL。
Use the getfacl and setfacl commands Here is an small tutorial: http://www.gnutoolbox.com/acls-setfacl/ But, btw: root will get access in every case.
使用getfacl和setfacl命令这是一个小教程:http://www.gnutoolbox.com/acls-setfacl/但是,btw:root将在每种情况下都可以访问。
#1
0
If you're talking about setting file permissions in Linux:
如果你在谈论在Linux中设置文件权限:
chmod 400 filename
#2
0
ACL's is, what you are looking for. by using ACL's you can set very granular restrictive access rules and also keep access for service users, like wwwrun and so on. It is important, that your filesystem supports ACL's.
ACL是,你在寻找什么。通过使用ACL,您可以设置非常精细的限制性访问规则,并保持对服务用户的访问,如wwwrun等。重要的是,您的文件系统支持ACL。
Use the getfacl and setfacl commands Here is an small tutorial: http://www.gnutoolbox.com/acls-setfacl/ But, btw: root will get access in every case.
使用getfacl和setfacl命令这是一个小教程:http://www.gnutoolbox.com/acls-setfacl/但是,btw:root将在每种情况下都可以访问。