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 06-14-2022, 05:44 PM   #1
dezix
Member
 
Registered: Sep 2017
Location: Frog's Land
Distribution: Debian
Posts: 98

Rep: Reputation: Disabled
Restricting /etc/passwd permissions


Hi!

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 :

Code:
I have no name!@server.net

Is there some way to better that ?

Thanks.
 
Old 06-14-2022, 09:48 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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.
 
2 members found this post helpful.
Old 06-15-2022, 01:54 AM   #3
dezix
Member
 
Registered: Sep 2017
Location: Frog's Land
Distribution: Debian
Posts: 98

Original Poster
Rep: Reputation: Disabled
Quote:
But, it's your system, so feel free to experiment with it as many ways as you like.
I was just checking for other "classic" config to hide admin's info in case of intrusion.

Setting up my own config to overcome this trouble overwhelm my actual knowledge.

Thanks for quick and kind reply.
 
Old 06-15-2022, 01:24 PM   #4
rufwoof
Member
 
Registered: Nov 2017
Distribution: Kernel+busybox+ssh+vnc+alsa (framebuffer)
Posts: 201

Rep: Reputation: Disabled
It's trivial to browse around and find other users (ls /home) and processes. Password hashes are stored in /etc/shadow, which is 600 permissions.
 
Old 06-15-2022, 05:10 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
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.
 
  


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] Legacy Account in /etc/passwd, /etc/shadow and/or /etc/group lalit singhania Linux - Newbie 4 06-07-2012 06:33 AM
Problem with /etc/passwd and /etc/passwd- files linuxravindra414 Linux - Newbie 2 01-15-2011 05:17 AM
[SOLVED] /etc/passwd- & /etc/shadow- & /etc/group- Mr. Alex Linux - Newbie 1 12-31-2010 05:19 AM
/etc/shadow and /etc/passwd permissions question lqchangba Linux - Security 2 02-20-2007 12:46 PM
/etc/passwd, /etc/shadow, /etc/group? Educate me :)! nutnut Linux - General 4 06-11-2005 07:47 PM

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

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