Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.