Cannot make directory '/var/run/screen/S-apache': Permission denied

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

Im using Cent OS 7

asked Aug 28 by jullegulle2000

1 Answer

There may be various possible reasons.

2 common reasons:

screen is not installed correctly.

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.

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

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

/var/run/screen dir group is '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.

SELinux blocks screen.

Check the log after you tried screen by user 'apache':

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

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

answered Aug 28 by Eric Z Ma (43,420 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost