Operating System - HP-UX
1849104 Members
8008 Online
104041 Solutions
New Discussion

Re: /etc/hosts devil permissions by default?

 
SOLVED
Go to solution
Jorge Fabregas
Regular Advisor

/etc/hosts devil permissions by default?

Hello everyone,

I noticed that in all of our 11i servers, the default permission for /etc/hosts is set to 666.

Why such an important file is world-writable by default?

Thanks in advance :)
Jorge
11 REPLIES 11
Gary L. Paveza, Jr.
Trusted Contributor

Re: /etc/hosts devil permissions by default?

I checked all my systems (19) and all of them had it as 644. And that isn't really needed since root can override the write permission - so it can be 444.

What version of 11i? We're running 11iv1 (11.11).
RAC_1
Honored Contributor

Re: /etc/hosts devil permissions by default?

Applications.programs would need to inquire about hosts details. So 444 are enought. Change it to 444, 666 are not required.

Anil
There is no substitute to HARDWORK
Simon Hargrave
Honored Contributor

Re: /etc/hosts devil permissions by default?

Are you using an Ignite build with customisations, or perhaps building from an Ignite tape? The default permissions for /etc/hosts on 11i is definately NOT 666 (it's 444 I believe).
Carlo Corthouts
Frequent Advisor

Re: /etc/hosts devil permissions by default?

The hosts file should never be world writable by default.

Do you know who last made changes to this file? Or is this the state after an installation.
Franky_1
Respected Contributor

Re: /etc/hosts devil permissions by default?

Hi,

maybe you have not umask set. By default files are created with 666 so umask "022" will result in 644 - that is what /etc/hosts should normally be

Regards

Franky
Don't worry be happy
Simon Hargrave
Honored Contributor
Solution

Re: /etc/hosts devil permissions by default?

I also suggest that you check your system for other world-writable files, since this may indicate one of many holes.

find / -perm -o+w

This should search your server for any other world writable files. You can then decide if they should be or not. Be careful though, as some (bad) applications may depend on this.
Jeff_Traigle
Honored Contributor

Re: /etc/hosts devil permissions by default?

You didn't specify which 11i version you're talking about, but the default permissions on my 11.11 system patched through June 2003 are 644. Sounds like someone modified them on yours... or a patch along the way set it incorrectly... or a patch along the way that would have corrected it didn't get applied. I would say chances are better for the first possibility though. In all the years I've been working with HP-UX, I don't recall ever having the defaults from the HP media setting permissions on /etc/hosts to anything other than 644.
--
Jeff Traigle
Jeff Schussele
Honored Contributor

Re: /etc/hosts devil permissions by default?

Hi Jorge,

That's a good question. I'd say someone/something had to have changed it.
Maybe admins are ftp'ing it around?
I checked several systems of ours & found a couple at 666 & the vast majority at 644.
A check of /usr/newconfig/etc/hosts shows it at 444. I believe 644 to be the proper perms.

My 2 cents,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Muthukumar_5
Honored Contributor

Re: /etc/hosts devil permissions by default?

Admin user changed the permission of that file. It has to be 444 ( readable by ALL ).

You can feel the difference between /etc/nsswitch.files there.

All default system files are given with 444 permission only.

Revoke it to normal. Some admin account known guys may be changed the one.

Regards
Muthu
Easy to suggest when don't know about the problem!
Jorge Fabregas
Regular Advisor

Re: /etc/hosts devil permissions by default?

Hello all,

Wow, thanks all for your replies! I'll give points in a few seconds!

I forgot to say that we're using 11.11. Hmmm I thought that it was the standard permission (after installation) although in fact I can't assure this since I haven't done an installation in months. I just assumed it was after installation because all of our 8 servers had it this way.

I didn't find any chmod command in root's shell history. Maybe it was a patch or the other administrator!

I'll definetely change it to 644.

Thanks for your replies. Now I'm SURE it is not this way after installation.

Jorge
Jorge Fabregas
Regular Advisor

Re: /etc/hosts devil permissions by default?

Thanks.