Discussion:
/etc/hosts rewriting problem
Pablo Wolter
2005-06-05 22:18:34 UTC
Permalink
Hi,

I use my laptop in home and office. For office I add manually a lot of
hosts under /etc/hosts as any linux/unix user use to do. But when I came
to home and click the icon of Network Connection in the right upper
corner of the screen and select the "home" location my /etc/hosts file
is empty and only showing the IP address of the hosts tab.

Can anyone teel me WHY in Ubuntu this strange behavior is ocurring? As
far as I know, /etc/hosts file should be only writable by root and NOT
by any user. There are other "security" problems like this enabled by
default in ubuntu that one should be aware of it?

Thanks in advance.

Pablo.
Martin Meredith
2005-06-05 22:28:31 UTC
Permalink
Post by Pablo Wolter
Hi,
I use my laptop in home and office. For office I add manually a lot of
hosts under /etc/hosts as any linux/unix user use to do. But when I came
to home and click the icon of Network Connection in the right upper
corner of the screen and select the "home" location my /etc/hosts file
is empty and only showing the IP address of the hosts tab.
Can anyone teel me WHY in Ubuntu this strange behavior is ocurring? As
far as I know, /etc/hosts file should be only writable by root and NOT
by any user. There are other "security" problems like this enabled by
default in ubuntu that one should be aware of it?
Thanks in advance.
Pablo.
Are you sure you're writing it propely, if you dont edit it as root, it
may not be saving it when you think it is. I've done this plenty of
times (still do sometimes and it confuses me :D)
Pablo Wolter
2005-06-06 00:33:45 UTC
Permalink
Post by Martin Meredith
Post by Pablo Wolter
Hi,
I use my laptop in home and office. For office I add manually a lot of
hosts under /etc/hosts as any linux/unix user use to do. But when I came
to home and click the icon of Network Connection in the right upper
corner of the screen and select the "home" location my /etc/hosts file
is empty and only showing the IP address of the hosts tab.
Can anyone teel me WHY in Ubuntu this strange behavior is ocurring? As
far as I know, /etc/hosts file should be only writable by root and NOT
by any user. There are other "security" problems like this enabled by
default in ubuntu that one should be aware of it?
Thanks in advance.
Pablo.
Are you sure you're writing it propely, if you dont edit it as root, it
may not be saving it when you think it is. I've done this plenty of
times (still do sometimes and it confuses me :D)
That's the funny part....I'm doing it as root and EVERY time I change
the location from Network Connection my /etc/hosts file is re writed.....
Martin Meredith
2005-06-06 00:46:16 UTC
Permalink
What's the output of ls -la /etc/hosts ??
Post by Pablo Wolter
Post by Martin Meredith
Post by Pablo Wolter
Hi,
I use my laptop in home and office. For office I add manually a lot of
hosts under /etc/hosts as any linux/unix user use to do. But when I came
to home and click the icon of Network Connection in the right upper
corner of the screen and select the "home" location my /etc/hosts file
is empty and only showing the IP address of the hosts tab.
Can anyone teel me WHY in Ubuntu this strange behavior is ocurring? As
far as I know, /etc/hosts file should be only writable by root and NOT
by any user. There are other "security" problems like this enabled by
default in ubuntu that one should be aware of it?
Thanks in advance.
Pablo.
Are you sure you're writing it propely, if you dont edit it as root, it
may not be saving it when you think it is. I've done this plenty of
times (still do sometimes and it confuses me :D)
That's the funny part....I'm doing it as root and EVERY time I change
the location from Network Connection my /etc/hosts file is re writed.....
Pablo Wolter
2005-06-06 00:54:38 UTC
Permalink
Post by Martin Meredith
What's the output of ls -la /etc/hosts ??
Post by Pablo Wolter
Post by Martin Meredith
Post by Pablo Wolter
Hi,
I use my laptop in home and office. For office I add manually a lot of
hosts under /etc/hosts as any linux/unix user use to do. But when I came
to home and click the icon of Network Connection in the right upper
corner of the screen and select the "home" location my /etc/hosts file
is empty and only showing the IP address of the hosts tab.
Can anyone teel me WHY in Ubuntu this strange behavior is ocurring? As
far as I know, /etc/hosts file should be only writable by root and NOT
by any user. There are other "security" problems like this enabled by
default in ubuntu that one should be aware of it?
Thanks in advance.
Pablo.
Are you sure you're writing it propely, if you dont edit it as root, it
may not be saving it when you think it is. I've done this plenty of
times (still do sometimes and it confuses me :D)
That's the funny part....I'm doing it as root and EVERY time I change
the location from Network Connection my /etc/hosts file is re writed.....
-rw-r--r-- 1 root root 1216 2005-06-05 17:16 /etc/hosts

Is not weird???

Thanks for the help
Martin Meredith
2005-06-06 01:14:06 UTC
Permalink
Very weird.

Only thing I can think is that there's some sort of daemon runnning in
the background and rewriting it... but i dont know why there would be
Martin Holt Juliussen
2005-06-06 09:35:17 UTC
Permalink
Post by Pablo Wolter
That's the funny part....I'm doing it as root and EVERY time I change
the location from Network Connection my /etc/hosts file is re writed.....
Have you checked if the hosts-file change back if you change location
back to the one you edited your hosts-file in? Network admin is runned
with sudo (gksudo), so it is no bug that it has the rights to edit the
hosts file. And if it changes the hosts-file back to the state it was in
the different locations I would call it a feature. If it just erase it
every time, I would file a bug.


Maybe I have misunderstood something, but hope this helps.

Martin
Pablo Wolter
2005-06-06 14:44:48 UTC
Permalink
Post by Martin Holt Juliussen
Post by Pablo Wolter
That's the funny part....I'm doing it as root and EVERY time I change
the location from Network Connection my /etc/hosts file is re writed.....
Have you checked if the hosts-file change back if you change location
back to the one you edited your hosts-file in? Network admin is runned
with sudo (gksudo), so it is no bug that it has the rights to edit the
hosts file. And if it changes the hosts-file back to the state it was in
the different locations I would call it a feature. If it just erase it
every time, I would file a bug.
Maybe I have misunderstood something, but hope this helps.
Martin
No, it don't change /etc/hosts back depending on location, it just
delete the entrys so it's a bug.

Thanks.

Pablo.

Loading...