douci1677 2014-03-16 15:26
浏览 284

将文件夹上的设置权限444阻止来自Web的访问

TL:DR Will permission 444 on a folder restrict access for a web user and browser?

I have a webserver with a root catalog that is accessible from the web. I can't access any folders higher up in the hiearchy, I only have control of the root folder and down.

Lets say I have the following folder structure:

  • includes
  • includes\database.php
  • admin
  • admin\index.php

I want the includes folder to follow these rules:

  • Accessible from within the server, so "admin/index.php" can include "includes/database.php"
  • Accessible via FTP, so I can access and edit the folder and files.
  • NOT Accessible by a user from the web.

Can I solve this by setting "includes" and all subfolders/files with permission 444? If so, is there a known way to bypass this access-rule or is it safe to use?

  • 写回答

1条回答 默认 最新

  • doukuizuo1795 2014-03-16 15:28
    关注

    If you want to keep assets safe from web access you need to move them outside of your web root. Typically one level below your web root is used. This way they are still accessible via FTP and your code but not to web requests.

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么