我没有使用SELinux,但是我仍然无法让Apache用户在我的缓存存储目录中创建文件。如果不使用chown
更改用户为实际的Apache用户,这种情况能行得通吗?
[root@server live_storage]# getenforce
Disabled
[root@server live_storage]# su -s /bin/bash -c 'touch /home/admin/live_storage/c50d02d942c0a3d.cache' apache
touch: cannot touch ‘/home/admin/live_storage/c50d02d942c0a3d.cache’:
Permission denied
[root@server admin]# ls -lsa
total 84
4 drwx------. 10 admin admin 4096 24 mei 10:32 .
4 drwxr-xr-x. 3 root root 4096 9 mei 11:12 ..
4 drwxrwxrwx 3 admin admin 4096 24 mei 10:33 live_storage
[admin@server live_storage]$ touch '/home/admin/live_storage/c50d02d942c0a3d.cache'
[admin@server live_storage]$ ls '/home/admin/live_storage/c50d02d942c0a3d.cache'
/home/admin/live_storage/c50d02d942c0a3d.cache
/home/admin/live_storage/c50d02d942c0a3d.cache
文件是否已存在? - Dusan Bajic[root@server live_storage]# su -s /bin/bash -c 'touch /home/admin/live_storage//c50d02d942c0a3d.cache'
touch: cannot touch ‘/home/admin/live_storage//c50d02d942c0a3d.cache’: Permission denied
[root@server live_storage]# su -s /bin/bash -c 'touch /home/admin/live_storage//c50d02d942c0a3d.cache' admin
[root@server live_storage]#
- JuNijland