Tech Support > Operating Systems > Linux / Variants > user editable hosts file
user editable hosts file
Posted by dkollar@melkor.dnp.fmph.uniba.sk on March 3rd, 2004




--
-----------------------------------------
Dr. Daniel Kollar
Max Planck Institut for Physics
(Werner Heisenberg Institut)
Foehringer Ring 6
D-80805 Munich
Germany

tel: ++49 (0)89 32354 327, 403, 472
fax: ++49 (0)89 32354 528
e-mail: dkollar@mppmu.mpg.de

Posted by Michael Heiming on March 3rd, 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

dkollar@melkor.dnp.fmph.uniba.sk wrote:

[ nothing ]

Looks like your question got somehow lost?

- --
Michael Heiming (GPG-Key ID: 0xEDD27B94)

Remove +SIGNS and www. if you expect an answer, sorry for
inconvenience, but I get tons of spam.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFARiWuAkPEju3Se5QRAro4AJ4z7Wtcc4AvC590/a0+2EdRoaLJhQCgxzq4
QI8hxOHjQH/+n4aBhHCUk84=
=UT+3
-----END PGP SIGNATURE-----

Posted by Martin Blume on March 3rd, 2004


"Michael Heiming" <michael+USENET@www.heiming.de> schrieb
This is a Heisenquestion. Look at his signature:

....
Max Planck Institut for Physics
(Werner Heisenberg Institut)
....

In order to get a feeling for Heisenquestions, have a look at:
http://www.jargon.net/jargonfile/h/heisenbug.html

:-)
Martin





Posted by Billy O'Connor on March 3rd, 2004


dkollar@melkor.dnp.fmph.uniba.sk writes:

Add the user to the /etc/sudoers file, then they'll be able to edit
/etc/hosts.
--
GNU/Linux revenues last quarter: $1 Billion.
micros~1 revenues last quarter: $4 Billion.
It's no longer a question of windows or GNU, it's a question of *Unix* or GNU.

Posted by Steve Wolfe on March 3rd, 2004


(snip)

Maybe he knew exactly how fast it was going.

steve




Posted by Eli the Bearded on March 3rd, 2004


In comp.os.linux.misc, Billy O'Connor <billyoc@gnuyork.org> wrote:
Wouldn't that allow them to run anything as root? Because if s/he
can run an editor as root, that editor can fork off new processes.

Wouldn't it be better to change the mode of /etc/hosts to allow
group editing, create a 'hosts' group, 'chgrp hosts /etc/hosts', and
then add the allowed user(s) to the hosts group?

You still have to worry about concurrent editing, whatever route
you take.

Elijah
------
has never set up a sudoers file

Posted by Bill Marcum on March 4th, 2004


On Wed, 3 Mar 2004 16:53:40 +0000 (UTC), dkollar@melkor.dnp.fmph.uniba.sk
<dkollar@melkor.dnp.fmph.uniba.sk> wrote:
a user?" I can see two possible ways: (1) group write permission,
(2) sudo.


--
Today is the first day of the rest of your life; but so was yesterday,
and look how you messed THAT up.


Posted by Bill Unruh on March 4th, 2004


Bill Marcum <bmarcum@iglou.com> writes:

]On Wed, 3 Mar 2004 16:53:40 +0000 (UTC), dkollar@melkor.dnp.fmph.uniba.sk
] <dkollar@melkor.dnp.fmph.uniba.sk> wrote:
]>
]>
]I assume you are asking "how do I make the /etc/hosts file editable by
]a user?" I can see two possible ways: (1) group write permission,
](2) sudo.

You could always do
chmod a+rw /etc/hosts.
Not terribly safe if you do not trust all of your users.

Posted by Noi on March 4th, 2004


On Wed, 03 Mar 2004 16:53:40 +0000, dkollar thoughtfully wrote:

Maybe ??
$ cp /etc/hosts /etc/hosts.original
$ cp /etc/hosts.original /home/public/hosts
$ ln -s /home/public/hosts /etc/hosts
$ chmod 765 /home/public/hosts

Posted by chris-usenet@roaima.co.uk on March 4th, 2004


Noi <noi@siam.com> wrote:
This appears to have almost exactly the same effect as chmod 765
/etc/hosts.

Why have you chosen permissions of 765, though?

This is equivalent to "u=rwx,g=rw,o=rx", which sets executable permission
for the owner and everyone not in the file's group permissions. I think
other people's suggestions of chmod 664 ("ug=rw,o=r") are better,
putting permitted editors of the hosts file into an editors group,
and ensuring the file has that same group membership.

Chris

Posted by Noi on March 4th, 2004


On Thu, 04 Mar 2004 09:16:46 +0000, chris-usenet thoughtfully wrote:

Yes you are right. My thought was put the hosts file into a directory
with ugo=rwx permissions to reduce the number of sudoers. The actual
permissions were demonstrative, ie, not well thought out.



Similar Posts