无法将目录设置为“ / var / run / screen / S-apache”:权限被拒绝

Hello! Im trying to create a screen folder for the user apache, Not root. But it seems to fail, I have no idea on how to fix this issue. I only get the error: Cannot make directory ‘/var/run/screen/S-apache’: Permission denied

你好! 我试图为用户的apache,而不是root创建一个屏幕文件夹。 但它似乎失败了,我不知道如何解决此问题。 我仅收到错误 :无法使目录“ / var / run / screen / S-apache”:权限被拒绝

Im using Cent OS 7

我正在使用Cent OS 7

There may be various possible reasons.

可能有多种可能的原因。

2 common reasons:

2个常见原因:

screen is not installed correctly.

screen未正确安装。

You may try using another non-root user to verify whether screen is installed and works correctly. It makes use of the setgid permission and these file/dir permissions should usually be as follows.

您可以尝试使用另一个非root用户来验证screen是否已安装并正常工作。 它利用setgid权限,这些文件/目录权限通常应如下所示。

screen binary’s group should be ‘screen’ and screen should have the ‘-s-‘ flag:

screen 二进制的组应为“屏幕”, screen应具有“ -s-”标志:

$ getfacl $(which screen)
getfacl: Removing leading '/' from absolute path names
# file: usr/bin/screen
# owner: root
# group: screen
# flags: -s-
user::rwx
group::r-x
other::r-x

/var/run/screen dir group is ‘screen’:

/var/run/screen dir组为“ screen”:

$ ls -lha /var/run/ | grep screen
drwxrwxr-x   3 root           screen           60 Aug 28 18:59 screen

If there are not like this, you may manually set them or re-install screen.

如果不是这样,您可以手动设置它们或重新安装screen

SELinux blocks screen.

SELinux阻止screen

Check the log after you tried screen by user ‘apache’:

尝试由用户“ apache”进行screen检查后查看日志:

# tail /var/log/audit/audit.log

and see whether it shows some messages related. If so, relax SELinux for the permissions.

并查看它是否显示一些相关消息。 如果是这样,请放宽SELinux的权限。

Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自: https://www.systutorials.com/cannot-make-directory-var-run-screen-s-apache-permission-denied/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值