简体   繁体   English

更改虚拟目录权限时,Apache Web服务器的CentOS / Linux权限错误

[英]CentOS/Linux Permission error from apache web server when changing virtual directory permissions

I have a need to create SSH accounts on my self managed hosted CentOS VPS. 我需要在自我托管的托管CentOS VPS上创建SSH帐户。 I want them to only have access to their own home directory. 我希望他们只能访问自己的主目录。 I would like to avoid a CHRoot Jail to keep things simple. 我想避免CHRoot监狱使事情变得简单。 I am hoping to achieve this with linux file permissions. 我希望通过linux文件权限来实现这一目标。

What I have done so far: 到目前为止,我所做的是:

  1. I backed up existing permissions using the following: getfacl -R / > permissions.acl 我使用以下命令备份了现有权限:getfacl -R /> Permissions.acl
  2. I ran an operation that would remove all world/other user access. 我执行了一项操作,该操作将删除所有世界/其他用户访问权限。 chmod -R o-rx / (modify permissions on root recursively, remove read and execute on other/world group. chmod -R o-rx /(以递归方式修改对root的权限,删除对其他/世界组的读取并执行。
  3. Tested existing sites: 已测试的现有站点:

Sorry cant post images as I am new and have no reputation 抱歉,由于我是新用户并且没有声誉,所以无法发布图片

Forbidden

You don't have permission to access /index.htm on this server.

Apache/2.2.15 (CentOS) mod_fcgid/2.3.7 PHP/5.3.3 mod_python/3.3.1 Python/2.6.6 mod_ssl/2.2.15 OpenSSL/1.0.0-fips mod_perl/2.0.4 Perl/v5.10.1 Server at www.ponmanconstructions.com Port 80
  1. Restored known working configuration. 恢复了已知的工作配置。

Any idea why this could be happening? 知道为什么会这样吗?

An ls -l on the folder in with the working configuration 工作配置所在文件夹中的ls -l

drwxrwxr-x  6 apache    root 4096 Jul 22 07:28 mysite.com

An ls -l on the folder in the required configuration (This config causes the Forbidden error) 所需配置中的文件夹上的ls -l(此配置会导致“禁止”错误)

drwxrwx---  6 apache    root 4096 Jul 22 07:28 mysite.com

apache user belongs to apache group too so if you don't give read & execute permission to that group so it becomes others ie why you get forbidden error. apache用户也属于apache组,因此,如果您不对该组授予读取和执行权限,则该组将成为其他组,即为什么会出现禁止错误。

Thanks & Regards, 感谢和问候,
Alok Thaker 阿洛·萨克(Alok Thaker)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM