LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-18-2018, 03:39 AM   #1
cbing
LQ Newbie
 
Registered: Apr 2012
Location: /root
Distribution: RHEL, CentOS, Fedora
Posts: 17

Rep: Reputation: Disabled
Permissions under /etc


Hi all,

I have a question regarding non-root permissions under /etc.
Is it safe to change the owner of a subdirectory tree and its files to a non-root user under /etc?.
Could it allow privilege escalation or any other security issues?.

Thanks.

CB.
 
Old 04-18-2018, 03:44 AM   #2
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,149

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Any specific reasons in mind why you want to do it?

Try in a non-production Linux box, see how it goes.
 
Old 04-18-2018, 03:47 AM   #3
cbing
LQ Newbie
 
Registered: Apr 2012
Location: /root
Distribution: RHEL, CentOS, Fedora
Posts: 17

Original Poster
Rep: Reputation: Disabled
Hello JJJCR.

I would just like to know the security implications that this would imply.

Thanks.

CB.
 
Old 04-18-2018, 04:02 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
I would say it is not really safe, but would be better to explain what do you want to change exactly.
 
Old 04-18-2018, 04:20 AM   #5
cbing
LQ Newbie
 
Registered: Apr 2012
Location: /root
Distribution: RHEL, CentOS, Fedora
Posts: 17

Original Poster
Rep: Reputation: Disabled
Hi,

For example, allow the apache user to own the files under /etc/httpd/* and edit them.

CB.
 
Old 04-18-2018, 05:20 AM   #6
cbing
LQ Newbie
 
Registered: Apr 2012
Location: /root
Distribution: RHEL, CentOS, Fedora
Posts: 17

Original Poster
Rep: Reputation: Disabled
I know about sudoedit, but the question is what security risks would be involved if there were directories and files from a non-root user in /etc.
 
Old 04-18-2018, 06:09 AM   #7
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
for example: if the user running apache owned those files a simple security hole will allow the intruder to acces/modify configuration.
If it was owned by root, regular users will not be able to do that.
 
Old 04-18-2018, 09:19 AM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
/opt and /usr/local/bin are for user installed stuff. For apache. That is a whole "separate system" within the system, so yes you (can) give directories their special permissions as needed to allow who or whatever to access the dir and or files within it. To each directory it has its own permissions "to allow or not to allow."

that is the question.

Their is plenty of how to's on setting up an apache Server on the internet. behoove of you to find the one you can understand to use as a guild line. good luck and enjoy.

Last edited by BW-userx; 04-18-2018 at 09:23 AM.
 
Old 04-18-2018, 08:23 PM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,149

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
As others suggested, don't mess up with the /etc permissions but use Apache method on how give permissions to directories within the Apache application.

If I am not wrong you can always change or point the directories to another location and specify the location on Apache.

It would be better if you will open a new thread and ask about Apache configuration if it is needed.
 
Old 04-20-2018, 01:18 AM   #10
cbing
LQ Newbie
 
Registered: Apr 2012
Location: /root
Distribution: RHEL, CentOS, Fedora
Posts: 17

Original Poster
Rep: Reputation: Disabled
Thanks for your answers.

It's not like I'm going to do something like that, I just want to understand why it should not be done.
If I install an application under /etc/app and change the owner to "app" with the user of the application, I understand that it will be easier to compromise that application than if the owner is root, but, apart from that, what problems can be generated by be under /etc?. What difference would there be if I do the same but under /opt/app?.
 
Old 04-20-2018, 02:19 AM   #11
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,149

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Not really a security expert, I believe in most circumstances you don't need to mess up with /etc and /opt directories just to give user permissions.

You can assign a user to a wheel group, sudoers or a steering wheel with a propeller group (just kidding) so they can have permissions to certain directories such as /etc and /opt but then giving permissions to a user who doesn't know what he is doing is just a bad idea.

Or giving a permission to a system folder to a particular user is also not a good idea, well it might be a workaround if you have 2 or 3 users on your network, just give them whole access to a folder so that they won't bother you anymore but then if the system got compromise who will bear the responsibility?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Samba and permissions ( permissions seems ok but wont work anyway ) spooksman Linux - Networking 1 04-10-2014 09:58 AM
setfacl changes group permissions; giving another user rw permissions secretlydead Linux - Server 4 09-22-2012 11:12 PM
relation between programs permissions and permissions of the files they use rblampain Linux - Security 1 07-10-2011 08:40 PM
[SOLVED] filesystem permissions question - making so user can't change permissions? c0pe Linux - Security 4 07-12-2010 09:06 AM
[SOLVED] Lack basic understanding of permissions(apache permissions problem) cK` Linux - Newbie 7 04-08-2010 11:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration