【发布时间】:2014-06-10 02:06:20
【问题描述】:
在使用 apache httpd 多年后,我开始使用 nginx。我用apt-get安装了nginx服务器,发现所有文件都归root所有。
debian@nginx-explore:~$ ls -la /usr/share/nginx/www/
total 16
drwxr-xr-x 2 root root 4096 Apr 23 21:09 .
drwxr-xr-x 3 root root 4096 Apr 23 21:09 ..
-rw-r--r-- 1 root root 383 Jul 7 2006 50x.html
-rw-r--r-- 1 root root 151 Oct 4 2004 index.html
主进程也归 root 所有,虽然有工作进程以 www-data 身份运行
debian@nginx-explore:~$ ps aux|grep nginx
root 2724 0.0 0.1 62348 1324 ? Ss Apr23 0:00 nginx: master process /usr/sbin/nginx
www-data 2725 0.0 0.1 62688 1624 ? S Apr23 0:03 nginx: worker process
www-data 2726 0.0 0.1 62688 1624 ? S Apr23 0:03 nginx: worker process
www-data 2727 0.0 0.1 62688 1624 ? S Apr23 0:03 nginx: worker process
www-data 2728 0.0 0.2 62688 2132 ? S Apr23 0:00 nginx: worker process
在 Apache 中,始终强调确保文件和进程不属于 root 作为安全措施。使用 nginx 时这不是什么大不了的事情有什么原因吗?
最终我需要知道是否应该调整 nginx 文件和文件夹的所有权以确保我的系统安全。
【问题讨论】:
-
我注意到在 Ubuntu 14.04 中,nginx 日志所有权已更改为 root,所以我也想知道。这似乎是维护者做出的一个有意识的决定,但它让我和你一样想知道。也许 serverfault 会更有帮助。
-
谢谢乔希。我刚刚发布了它serverfault.com/questions/592071/…。这可能是我应该开始的地方。
标签: linux apache nginx system-administration ownership