Root Directory Permission Error

General support questions
Post Reply
asterdeve
Posts: 3
Joined: 2018/03/07 19:47:53

Root Directory Permission Error

Post by asterdeve » 2018/03/07 20:00:15

Dear,
Viewers, I am facing issue with CentOS file permission, I have some .conf file in /root/sys directory & when I am trying to open those files or write into those files I am getting a permission error

failed to open stream: Permission denied, but if I keep those file in other directories its working fine.

I need help how to give permission to root directory, Thanks for your kind attention, wait for your reply.

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Root Directory Permission Error

Post by TrevorH » 2018/03/07 20:34:57

What is trying to use the files ? Files in /root should only be readable by the root user, no-one else.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

asterdeve
Posts: 3
Joined: 2018/03/07 19:47:53

Re: Root Directory Permission Error

Post by asterdeve » 2018/03/07 20:38:15

TrevorH wrote:What is trying to use the files? Files in /root should only be readable by the root user, no-one else.
You mean to say I can't give permission to write the file by WebServer? those files are asterisk config files its customized asterisk

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Root Directory Permission Error

Post by TrevorH » 2018/03/07 20:54:28

Pick a different location to keep your file. That directory belongs to the root user and should not have any permissions for anyone else in the system, most especially not something as easily hackable as a web server.

Configuration files that belong to asterisk should reside in /etc/asterisk. It should have read permission on those files and ideally it should not have write access... at least I've been running about 50 asterisk systems for the last 6 years and none of those have write acccess to anything in /etc/asterisk. Files that it needs to write should be in /var/lib/asterisk or /var/run/asterisk or their subdirectories.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

asterdeve
Posts: 3
Joined: 2018/03/07 19:47:53

Re: Root Directory Permission Error

Post by asterdeve » 2018/03/07 22:51:32

TrevorH wrote:Pick a different location to keep your file. That directory belongs to the root user and should not have any permissions for anyone else in the system, most especially not something as easily hackable as a web server.

Configuration files that belong to asterisk should reside in /etc/asterisk. It should have read permission on those files and ideally it should not have write access... at least I've been running about 50 asterisk systems for the last 6 years and none of those have write acccess to anything in /etc/asterisk. Files that it needs to write should be in /var/lib/asterisk or /var/run/asterisk or their subdirectories.

I know sir but this our developer make customized Asterisk which can run only from root directory, if I changed the directory it won't work anymore, please help me if there is any possibility to give permission read/write of root dir

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Root Directory Permission Error

Post by TrevorH » 2018/03/07 23:22:15

Tell your developer not to be stupid. Asterisk hasn't needed to run as root for years and for security, it should not do so.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply