1752297 Members
5026 Online
108786 Solutions
New Discussion юеВ

/etc/passwd permission

 
SOLVED
Go to solution
James Odak
Valued Contributor

/etc/passwd permission

Is there any reason the /etc/passwd file must be 444?

-r--r--r-- 1 root root 10529 Oct 7 15:00 /etc/passwd


can i make it 440 (why would you want the world to be able to read the passwd file?)

-r--r----- 1 root root 10529 Oct 7 15:04 /etc/passwd
6 REPLIES 6
Patrick Wallek
Honored Contributor
Solution

Re: /etc/passwd permission

Errors can result if you make the passwd file permissions 440.

The biggest issue is that is you make the passwd file permissions 440, then a regular user will see the UID numbers instead of user ids when they do an ls -l.

Users must be able to read the passwd file in order for ls (and other things) to be able to translate UID numbers to the actual user id names.

Patrick Wallek
Honored Contributor

Re: /etc/passwd permission

By the way, if you are concerned about users seeing encrypted passwords in the /etc/passwd file, then you should convert your machine to trusted mode.
Geoff Wild
Honored Contributor

Re: /etc/passwd permission

Or, if you don't want trusted - install Shadow Password:

http://www.software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=ShadowPassword

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
John Poff
Honored Contributor

Re: /etc/passwd permission

Hi,

One of the things that will break when /etc/passwd is set to 440 permissions is the 'whoami' command, which will return 'Intruder alert.' when issued.

It's kind of fun to change those permissions on a slow day and listen to our Oracle DBAs get excited when they login to a box and see that message. :)

JP
Bill Hassell
Honored Contributor

Re: /etc/passwd permission

440 will not allow users to use a number of commands like ls -l or ll. Every time you list a directory to show ownership, the passwd file must be read to decode the UID into a name. The passwd file must always be readable. The encrypted password cannot be decrypted but can be guessed which is the reason to enable Trusted System or use the new (11.11 only) Shadow Password feature.


Bill Hassell, sysadmin
James Odak
Valued Contributor

Re: /etc/passwd permission

Thanks