LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 07-17-2003, 12:23 PM   #1
cdhjrt
Member
 
Registered: Mar 2002
Location: Marysville, WA
Distribution: Redhat, Win2K, Solaris
Posts: 45

Rep: Reputation: 15
Question /etc/passwd security


In the interest of security is there any reason to make /etc/passwd and /etc/group 0400?

I would think some applications need to be able to map uid to username (ls -l). After making this change ls -l still works so does "groups" and "id -ap user".

Since the name service caches passwd and group on startup, makeing them fully available to users, do we gain anything from makeing them 0400?

Thanks
 
Old 07-17-2003, 12:31 PM   #2
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Rep: Reputation: 15
I'm not sure what you mean by ls -l, But yes it is standard parctice that the passwd, shadow, and group files have the 400 permissions set. Commands such as "passwd" that could possibly be run by a non-priviledged user have a SUID on them which will temporarily grant access to the files in order to make any modifications.
 
Old 07-17-2003, 01:21 PM   #3
cdhjrt
Member
 
Registered: Mar 2002
Location: Marysville, WA
Distribution: Redhat, Win2K, Solaris
Posts: 45

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by def1014
I'm not sure what you mean by ls -l,
The inodes have the UID and GID of a file. In order for ls -l to list usernames and group names it needs to access /etc/passwd (or a cached version of it, which is what it does).

If applications can call on the cached version of passwd and group then what is the benifit of making them 0400? It might make the admins life more difficult though.
 
Old 07-17-2003, 01:40 PM   #4
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Rep: Reputation: 15
Yes, the inodes do contain UID and GID information of the file, but I'm not sure that these usernames and groups are cached at boot. I was under the impression these names were gotten as stated in the nsswitch.conf. What I was trying to explain is that when you have commands that have the SUID set on them, they are run as root...even by regular users. Not sure if ls is one of these commands. I don't know of anywhere else where you would be able to get the list of users on a system other than these files. Could you give me a scenario where you would need to give more rights to these particular files. Why would anyone else other than root need to read or write to them? It is a standard security precaution. If you need to give other people certain rights, I would look into something like sudo.
 
Old 07-17-2003, 01:45 PM   #5
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You'll break many things if normal users are not able to read /etc/passwd and /etc/group. Luckily Solaris does put the actual passwords in /etc/shadow which is 0400.
 
Old 07-17-2003, 01:47 PM   #6
def1014
Member
 
Registered: Apr 2002
Distribution: Red Hat 6.1,7.2,7.3 Mandrake 8.1,8.2
Posts: 48

Rep: Reputation: 15
My bad, you're right. I keep thinking of /etc/shadow. the permissions on /etc/passwd and /etc/group should be 644.
 
Old 07-17-2003, 01:47 PM   #7
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You could always try it as an experiment.
 
  


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
help needed in security ,vonarabilities ,loopholes in linux security haseebnazar Linux - Security 2 11-23-2005 07:16 PM
enhance security from passwd file KitshiNg Linux - Security 1 11-19-2005 04:23 PM
[Security Questions] Last Login, how good is this feature for security breach info? t3gah Linux - Security 2 06-14-2005 01:02 AM
what are the security risks using 'passwd' in shell scripts? MisterESauce Linux - Security 5 04-10-2005 01:48 PM
Login Process & Security of /etc/passwd and /etc/shadow arut Solaris / OpenSolaris 3 12-27-2004 01:13 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 11:43 AM.

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