Re: Several issues with /etc/hosts.allow at a university setting

From: Unruh (unruh-spam_at_physics.ubc.ca)
Date: 08/31/05


Date: 31 Aug 2005 07:19:26 GMT

dpdoughe@allvantage.com writes:

>Recently I was required to "register" my laptop (running Fedora 3) with
>my university's computer support office in order to use their internet
>on campus. Somehow in this self-guided on-line process they
>automatically created a new hostname for my computer.

It is complete lunacyto use localhost for the name of your machine.
Also dhcp by default asks for a new hostname and you have to specifically
ask it not to.

>The next time I booted up with the ethernet connected, my computer
>booted under this new hostname rather than localhost (as it will do if
>I don't have the ethernet plugged in at boot time). Basically I am
>very frustrated by this because I consider this having been "hacked".
>I never created the hostname on my computer or did anything to tell my

How can it be hacked when you asked it to give you a new hostname? That you
did so in ignorance is irrelevant. It is like signing a cntract without
reading it, and then complaining about the terms.

>computer that it should boot up under anything but localhost. Is this
>some default setting in dhcp perhaps??? How to remove?

Use man for the particular dhcp client you use.

>Other problems that occur of this new arrangement is that my display
>won't work if booted under the new hostname. If I boot under localhost
>(ethernet cable not plugged in) then I get display up (as usual). But
>as soon as I plug the ethernet cable and do "/sbin/ifup eth0", the
>hostname switches to the new host name and I lose the ability to open
>any new apps requiring the display. I can do "xhost +" prior to
>calling /sbin/ifup and everthing will work fine.

Yes, that is a feature of X.

>However, I've heard xhost + is an insecure way of doing things though
>since it allows all hosts. Trying more restrictive "xhost hostname"
>etc did not fix the display problem only "xhost +" seems to work.

>Questions:
>1) I don't want to be booted into the new host name even if the
>ethernet is plugged in and active at boot. How do I turn off this
>automatic "get thyself hacked" behavior. Basically when I want to
It is NOT a hack.
>connect to the internet I'd like to a) switch to the new hostname and
>then b) do /sbin/ifup eth0. In otherwords I want to be able to control
>the hostname of my own damn computer. Seems reasonable to me...

read the man page.

>2) I assume X is not aware of the new host name. I thought adding the
>new host to /etc/hosts.allow was the prefered way rather than xhost +.
>But this doesn't seem to do anything at all. Is /etc/hosts.allow the
>correct file to use for this?

No. X has opened itself on hostname:0 and your new computer name is
different. hosts.allow has nothing to do with this.

>3) Another drag is that if I yank the connection to the internet after
>being booted into the new host name, the display is again in a
>non-functional state. How do I get back control of the display. In
>other words, there should be a way of stating OK now go back to being
>localhost and run display from there.



Relevant Pages

  • Re: problem regarding setting DISPLAY env variable and hostname
    ... The hostname is not specified. ... 127.0.0.1 localhost xenon ... It prints a lot information about the current display. ... the virtual console that you start X11 in. ...
    (freebsd-questions)
  • Re: (was Re: setting FQDN in /etc/hosts)
    ... There should be a space before the word localhost, ... the hostname command will tell you what ... 503 Leafnode must have a unique fully-qualified domain name. ... ## This is the NNTP server leafnode fetches its news from. ...
    (news.software.readers)
  • Re: HP-UX / VUE trouble
    ... The correct hostname is in /etc/src.sh. ... gateway and the definition of localhost as well. ... mserve allow 127.0.0.1 unknown mysystemname mysystemname.domain localhost ... in spc and mserve allow. ...
    (comp.sys.hp.hpux)
  • Re: dhcppc1 in the file /etc/hosts error
    ... my Internet service works fine. ... give your host a hostname different than localhost. ... script will change the hostname to something different. ... legal statement: http://www.uni-x.org/legal.html Fedora GNU/Linux Core 2 on Athlon kernel 2.6.9-1.6_FC2smp ...
    (Fedora)
  • Re: Opening file too slow
    ... localhost ... csv610@blackhole:~$ hostname -f ... Now reboot - don't just log out, ... adding '127.0.1.1 ' should not have affected your internet ...
    (Ubuntu)