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.
As a naif new security system master,
I though that setting "hard to find" admin's users names and random UID
would be a good mean to harden server access.
The above make no sens if an attacker that gets access to ordinary (non-admin) account
is allowed to read /etc/passwd file.
The issue is that setting 600 permissions for /etc/passwd has serious drawback :
No. The /etc/passwd file is what maps numeric UIDs to user names, and quite a few commands ("ls -l" being the leading example) will not function properly unless /etc/passwd is globally readable. Also, using something other than "root" as the super user's uname will cause a few programs and procedures to misbehave.
But, it's your system, so feel free to break it experiment with it as many ways as you like.
In modern Unix/Linux systems, the /etc/passwd file is required as a mapping of "uid" values to "user names," just as /etc/groups is used for "gids."
But, these files are no longer part of the actual security system. The "password" field is no longer populated, nor used. There are no secrets here.
In the simplest case, "shadow passwords" are stored in a directory that no one but root can read. But there are other authentication possibilities, including full "LDAP/OpenDirectory" participation in a corporate-wide "single sign-on" arrangement.
The underlying Linux technology which enables all of this is quite interesting: "PAM = Programmable Authentication Modules." It is remarkably flexible, and used in many cases, and I encourage you to research how it all works. It's really quite well-done.
Do not attempt to restrict access to /etc/passwd or /etc/groups. You have nothing secret there to hide, and you could break many things.
Last edited by sundialsvcs; 06-15-2022 at 05:16 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.