Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 11-05-2008, 05:28 PM   #1
LQ Newbie
Registered: Jan 2005
Posts: 7

Rep: Reputation: Disabled
GDM, xhost, and permanently adding hosts?


Firstly, I hope this is posted in the right forum section. I debated between several sections before deciding to post here. I apologize if this is the wrong place.

Recently I installed Debian Etch on a laptop. It has been a few years since I have used Linux so I am feeling a bit rusty.

When a user runs Xorg by itself with 'startx' or 'X' and then checking out the allow list with 'xhost', there is a default list which looks like:

However, when Xorg is started from GDM, the list is completely empty, preventing me from spawning gui apps from the console into :0.0, as I am in the habit of doing, unless I first login through GDM as any user, and then issue the 'xhost +localhost' command. It is also necessary for me to host remote apps from trusted machines. What I would like to be able to do is to modify the default lists for both GDM and for displays initiated through startx.

In particular, I would like to know where GDM is hiding this configuration, why it excludes localhost by default when X includes it, where Xorg is hiding this configuration, and what is the proper way to change them without modifying .profile scripts and so forth. I have read something about a /etc/X*.hosts file, but no such file exists on my system.

Thanks for looking.


Last edited by bCookie; 11-05-2008 at 05:33 PM.
Old 11-06-2008, 01:07 AM   #2
LQ Newbie
Registered: Jan 2005
Posts: 7

Original Poster
Rep: Reputation: Disabled
Hi again,

Well, finally after a lot of googling and some man page browsing, I found this in the man page of Xserver(1) in the "Granting Access" section, which, for the most part, satisfies my inquiry:

The X server also uses a host-based access control list for deciding whether or not to accept connections from clients on a particular machine. If no other authorization mechanism is being used, this list initially consists of the host on which the server is running as well as any machines listed in the file /etc/Xn.hosts, where n is the display number of the server.
So I guess that explains where the initial host list comes from. And it seems gdm's initial host list is empty because its init scripts specify -auth when invoking X.

However, I should point out a discrepancy in the documentation quoted above with the actual behaviour of the software. I guess it is not so much of a logical problem as a wording problem, as the wording is somewhat misleading, and not completely clear about the exact conditions for Xn.hosts to be imported. Specifically, when another authorization mechanism is used, X imports the host list in /etc/Xn.hosts, but does not import the hostnames/addresses of the machine on which the server is running. Simply having my X0.hosts present seems to make gdm work the way I want, but this documentation leads me to believe that this shouldn't actually work. Can anyone comment on this?

Last edited by bCookie; 11-06-2008 at 01:46 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding KDE in GDM krussell Ubuntu 1 08-08-2006 06:27 AM
Permanently Adding iptable rules GUIPenguin Linux - Networking 2 10-13-2004 12:27 AM
How to permanently add localhost via xhost? h00chman Linux - Newbie 1 04-24-2004 12:57 AM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 04:52 PM
permanently adding to the path hyphenage Linux - General 12 07-16-2003 02:14 AM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 02:16 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration