LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 12-13-2002, 04:41 AM   #1
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Rep: Reputation: 15
Blocking X11


Posted: Dec 13, 2002 - 08:31 Hi,
Does anyone know how to stop X11 from listening. It seems to listen on port 6000.
I have managed to turn off all other services and then scanning with nmap my own machine.

It shows:-
port state Service
22/tcp open ssh
6000/tcp open X11

I could just block port 6000 but new connections can be set up on higher random allocated ports. I want to stop X11 showng as listening when scanned and prevent connections to the service and still be able to use X-windows on the localhost.
 
Old 12-13-2002, 06:06 AM   #2
RuZz
LQ Newbie
 
Registered: Dec 2002
Location: Sweden
Distribution: Slackware 8.1
Posts: 5

Rep: Reputation: 0
add this to your
/usr/X11R6/bin/startx:
serverargs="-nolisten tcp"
 
Old 12-13-2002, 07:25 AM   #3
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
That works. Great.
Cheers.
 
Old 12-19-2002, 04:20 PM   #4
ubien
Member
 
Registered: Oct 2002
Distribution: RH 8.0 and fluxbox
Posts: 122

Rep: Reputation: 15
Does this work if you boot into a GUI? How would you do it if that doesn't stop it?
 
Old 12-20-2002, 01:05 AM   #5
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
I cant see why it shouldnt. Have you tried it?

ps -eaf shows

xinit /root/.xinitrc -- /usr/X11R6/bin/X -nolisten tcp

so xinit is starting X with the -nolisten tcp argument after the change .
 
Old 12-20-2002, 01:19 AM   #6
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
No it doesnt. I just tried it.

I edited the inittab to default to run level 5
I now get the GUI login
I now get a terminal window with a black background instead of white, (whys that different).

netstat -peat shows that X11 is listening on port 6000

So whys that different? anyone?
And how do I change it?, because this would be the preffered way of starting X sometimes.

More questions than answers.
 
Old 12-20-2002, 03:19 AM   #7
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
An update,

ok, when I boot up into the GUI I get the gnome desktop,
thats why the default terminal is black.
When I startx manually from run level 3 I am using the ICE window manager.

I prefer the ICE wm so how do I get that to be default?

Help!

Maybe this cant be done! from the X man page I can only find Host Access. I dont think this stops X11 from listening though. It allows connections and checks if there is a permission to "connect".
Is that true.

Turns out that xdm is used for a GUI logon and that xinit is used for a manual start of the GUI.

I have rewritten the /usr/X11R6/bin/Xssession file and can get ICE wm to start as the GUI automatically
.
Now I have X11 showing up in Netstat -peat again listening on port 6000.

Its a relief in a way because I thought I was getting away from the security issue.

So, any Ideas how to stop X from listening when defaulting to the GUI during log on.

Last edited by neil; 12-20-2002 at 07:36 AM.
 
Old 12-20-2002, 09:26 AM   #8
RuZz
LQ Newbie
 
Registered: Dec 2002
Location: Sweden
Distribution: Slackware 8.1
Posts: 5

Rep: Reputation: 0
i myself was trying to do allmost the same thing as you my friend, and i found it quite tricky. my advise is to use some session-manager like gdm (gnome display manager), kdm (kde display manager) instead of just plain xdm. if you use gdm (like i do) then i might be able to help. i did like this: edit file /etc/X11/gdm/gdm.conf (at least thats where i found it on my slackware 8.1) just search for it otherwise. find the line "StandardXServer=/usr/X11R6/bin/X" and add the -nolisten tcp flag, etc "StandardXServer=/usr/X11R6/bin/X -nolisten tcp" then there is another opton witch is probably the important one, looks something like this:
#
# Definition of the standard X server.
[server-Standard]
name=Standard server
command=/usr/X11R6/bin/X
flexible=true

edit the "command=/usr/X11R6/bin/X" to "command=/usr/X11R6/bin/X -nolisten tcp" (no " off course).
save the file and try again. i tried to find out how to do the same with "xdm" but i cant seem to understand how. anyway gdm works fine for me.
 
Old 12-20-2002, 09:42 AM   #9
RuZz
LQ Newbie
 
Registered: Dec 2002
Location: Sweden
Distribution: Slackware 8.1
Posts: 5

Rep: Reputation: 0
hmm, i think i missed the obvios, "/etc/X11/xdm" contains a file called "Xservers" in the file there is a line ":0 local /usr/X11R6/bin/X" probably just change it to:
:0 local /usr/X11R6/bin/X -nolisten tcp will do the trick..
hope this helped.
 
Old 02-04-2003, 09:28 AM   #10
neil
Member
 
Registered: Jul 2001
Location: Kent, UK
Distribution: /Fedora/Debian/Ubuntu/Xubuntu
Posts: 108

Original Poster
Rep: Reputation: 15
Thanks RuZz
I will try this out.
Sorry for lack of response. I am installing a Kitchen!!
This seems to be the solution as other forums are saying the same thing.
Cheers.
 
  


Reply



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
Core 4 - X11-devel complains about X11-libs which are installed Ephracis Fedora 3 09-05-2005 09:32 AM
xorg-x11-libs required by xorg-x11-devel darknails Fedora 1 01-13-2005 02:34 PM
IP Blocking Help mortsahl Linux - Security 2 04-26-2004 08:29 AM
Roaming X11/Xfree86, X11 proxy zapp Linux - Software 1 09-12-2003 08:06 AM
IP blocking merlin371 Linux - Networking 2 08-04-2003 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:40 AM.

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