Re: Disabling X and KDM from listening on a port.

From: Luca Fornasari (
Date: 08/14/01

Date: Tue, 14 Aug 2001 20:46:01 +0200 (CEST)
From: Luca Fornasari <>
To: Rob Bos <>
Subject: Re: Disabling X and KDM from listening on a port.
Message-ID: <>

On Tue, 14 Aug 2001, Rob Bos wrote:

> On Tue, Aug 14, 2001 at 07:01:55PM +0200, Luca Fornasari wrote:
> > On Tue, 14 Aug 2001, Rob Bos wrote:
> >
> > > default. I took a quick look at my X configuration; Debian has -nolisten tcp
> > > on by default, which is fortunate.
> >
> > Which version of Debian are you running?
> I'm using the XFree86 4.1.0-2 packages on sid right now; from
> /etc/X11/xinit/xserverrc, which handles all startups of the X server:
> #!/bin/sh
> exec /usr/bin/X11/X -dpi 100 -nolisten tcp -verbose

Thx for your reply ... excuseme the reply on the mailing list but i think
it can be usefull for all.
In Debian potato (2.2 all releases) this is not the default; you have to
add the -nolisten tcp flag in the file you have mentioned by hand (or
better you have to create the file). Please note that this stops X from
listening on port 6000 *only* if you use the startx command to start it.
With xinit the matter is different because you cant use -nolisten tcp and
all users on the system must have access to xinit.
The only way I found to prevent users from launching X that binds to port
6000 is to launch xdm (configured properly ... dont forget that also xdm
binds to port) at startup! The flag to use with xdm is -udpPort 0
Then xdm reads /etc/X11/xinit/xserverrc and launch X with the appropiate
arguments. Users cant use xinit to launch X because X is already running.
Any comment?

Luca Fornasari        
System Manager        
EasyBit                         tel:+39-011-6696692 M. D'Azeglio 78            fax:+39-011-6697824
I-10126 Torino IT               gsm:+39-348-2649029