LinuxQuestions.org
Visit Jeremy's Blog.
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 08-11-2007, 09:07 AM   #1
mistersnorfles
Member
 
Registered: Aug 2007
Distribution: Gentoo 2007.0
Posts: 51

Rep: Reputation: 15
Setting Up A File Permissions Policy


All I can find on file permissions is how to user chmod, chgrp, etc. Are there any good sites you folks know of that talk strategies for setting up secure file permission schemes?

For instance, which system files to leave world readable, and which ones can be made only readable by root. Or things like setting good policies for putting users into groups with minimum necessary access rights?

Thanks,
Mr. Snorfles
 
Old 08-11-2007, 10:59 AM   #2
bakfupai
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: CentOS, RHEL, SourceMage, OpenBSD
Posts: 40

Rep: Reputation: 15
I'm not aware of such a site but it might very well exist. Anyway, the default permissions are usually quite a good compromise between security and usability imo. If you want to tighten things you can for example change the umask to 027 which makes files rw for the owner, r for the group and the rest can't access it whatsoever. Though this just applies to files and dirs created after the change of umask.

Other files you might want to restrict access to might be the logs in /var/log (and sometimes other places) and perhaps the firewall and other security related info. Obviously ssh keys need to have restrictive permissions but ssh will remind you if you use a key that is world readable.

Otherwise, just sit down and think about what data is for only one user to see and which data should be shared.
 
Old 08-11-2007, 01:34 PM   #3
mistersnorfles
Member
 
Registered: Aug 2007
Distribution: Gentoo 2007.0
Posts: 51

Original Poster
Rep: Reputation: 15
Is it OK to block access to /etc for non-root users?

What about system configuration programs? I know some programs like apache have their own username, so I was worried that if I made everything accessible only to root, that some programs wouldn't be able to function properly, as a result of not having sufficient permissions to access files they need. Would I completely lock myself out if I made everything in the /etc folder only visible to root? Or is it OK to just block everything, and just see which programs give me permission denied messages and fix the problems as they come up. I just don't want to test it to find out, and discover that my system isn't usable anymore.

Thanks,
Mr. Snorfles
 
Old 08-12-2007, 06:10 AM   #4
bakfupai
Member
 
Registered: Apr 2006
Location: Sweden
Distribution: CentOS, RHEL, SourceMage, OpenBSD
Posts: 40

Rep: Reputation: 15
It is definitely a BAD idea to make all files in /etc only readable by root. There are a lot of files that NEED to be read by users.

Anyway, I need to ask you this: Which info do you consider secret in /etc? Most of the things there are of little or no use to an attacker.

But if you want to have more restrictive permissions in /etc I suggest you start small with perhaps the configuration for apache or some other server. Make sure you take a backup of /etc before starting to experiment.
 
  


Reply

Tags
access, file, groups, permissions, policy



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
Setting initial file permissions glabiche Linux - Security 5 11-29-2005 05:37 AM
Need help regarding setting Perl and file permissions... mrbadi Programming 1 07-30-2005 04:43 PM
Need help regarding setting Perl and file permissions... mrbadi Linux - Software 1 07-26-2005 01:03 PM
Automatically Setting File Permissions in a Directory maneeshsethi Linux - Security 2 05-27-2004 07:42 PM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM

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

All times are GMT -5. The time now is 03:07 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