LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 06-28-2014, 10:50 PM   #1
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Rep: Reputation: 242Reputation: 242Reputation: 242
Yet another "how can I close port 6000?" post.


On a friend's computer, Slackware 14.1 32bit, no KDE, using XFCE with XDM to login to X...

following instructions at
http://docs.slackware.com/howtos:sec...basic_security
I made the file /etc/X11/xinit/xserverrc with the contents"
Code:
#!/bin/sh
 
exec /usr/bin/X -nolisten tcp
...and when that didn't work, made the ~/.xserverrc file, and when that didn't work, I added -nolisten to
Code:
local /usr/bin/X
in /usr/X11R6/lib/X11/xdm/Xservers
...and when that didn't work, I came here.

Has something changed in X, or something? At the very least, the statement "On Slackware, listening for incoming XDMCP requests is disabled by default in both xdm and kdm, so it is secure by default." from the above link is wrong. 6000/tcp open X11 has been like this since day one on this system. It won't be the end of the world if I can't close port 6000, but it will be one step closer to the end of my love affair with this whole "Linux" thing. Just so tired of the constant change.
Much appreciation for any clues!
 
Old 06-29-2014, 12:58 AM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
What I do is edit /usr/bin/startx and add "-nolisten tcp" to this line:

Code:
serverargs="-nolisten tcp"
Which is empty by default. Seems to work...
 
Old 06-29-2014, 01:05 AM   #3
turtleli
Member
 
Registered: Aug 2012
Location: UK
Posts: 206

Rep: Reputation: Disabled
xserverrc is only for startx, not for xdm.

This is totally untested, but for xdm you can try and modify /usr/lib/X11/xdm/Xaccess (or whatever the DisplayManager.accessFile is set to in /etc/X11/xdm/xdm-config) to have an empty LISTEN line (see the xdm man page for details).

EDIT: Was it -nolisten or -nolisten tcp you added to the line in /usr/X11R6/lib/X11/xdm/Xservers?

Last edited by turtleli; 06-29-2014 at 01:09 AM.
 
Old 06-29-2014, 03:27 AM   #4
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Code:
:0 local /usr/bin/X :0 vt7 -br -nolisten tcp
in /etc/X11/xdm/Xservers does the job for me.
 
Old 06-29-2014, 08:14 AM   #5
pataphysician
Member
 
Registered: Oct 2012
Posts: 77

Rep: Reputation: Disabled
I use kdm, but my /etc/X11/xdm/xdm-config
has these lines from default install in 14.1:


! SECURITY: do not listen for XDMCP or Chooser requests
! Comment out this line if you want to manage X terminals with xdm
DisplayManager.requestPort: 0


Which should disable XDMCP

unless this somehow got changed on your machine, I'm not sure why xdm has that port open.

I'm not sure if your using nmap to look for open ports, but if you are, and your scanning your public ip address, you might see some stuff that is from your router/modem that is not really open on the public side, the router/modem has ports open for the local network but also allows machines accessing it from the local side to also use the public ip address to access (that is, it loops back on your public ip). Nmap without any additional parameters just guesses based on port number what the service is.

For example if I scan my Public IP from behind the network, nmap will list 1024 kdm as open. This is actually not kdm, but a port used by the router for configuration, it is actually only open on the local network, if I scan my public IP from another network it will not be listed.

So is port 6000 actually open if you scan the local IP address of this machine, if not then it is probably a port open on router/modem or other device, possibly really only open to the local network, though maybe not.

you can use
nmap -p portnumber -A ipaddress
command to make nmap scan what some open port really is, instead of guessing.

In my case port 1024 is a mini-httpd running on my router not kdm at all.
 
Old 06-29-2014, 12:37 PM   #6
STDOUBT
Member
 
Registered: May 2010
Location: Stumptown
Distribution: Slackware64
Posts: 583

Original Poster
Rep: Reputation: 242Reputation: 242Reputation: 242
Quote:
Originally Posted by turtleli View Post
EDIT: Was it -nolisten or -nolisten tcp you added to the line in /usr/X11R6/lib/X11/xdm/Xservers?
It was just -nolisten like it showed at the site I linked. :-\

Quote:
Originally Posted by Diantre View Post
What I do is edit /usr/bin/startx and add "-nolisten tcp" to this line:

Code:
serverargs="-nolisten tcp"
Which is empty by default. Seems to work...
I was kinda leery of editing that file.

Quote:
Originally Posted by pataphysician View Post
you can use
nmap -p portnumber -A ipaddress
command to make nmap scan what some open port really is, instead of guessing.
I was sure it was this local machine, since I used simply, nmap 127.0.0.1
Quote:
Originally Posted by GazL View Post
Code:
:0 local /usr/bin/X :0 vt7 -br -nolisten tcp
in /etc/X11/xdm/Xservers does the job for me.
I tried this since it directly related to XDM. It worked after rebooting (seems X doesn't actually die
anymore if one simply logs out or uses Ctl+Alt+Backspace).
Thank you all!!! Going to add this one to my recepie book! ;-)
 
Old 06-30-2014, 01:49 PM   #7
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
For KDM, you want
Code:
ServerArgsLocal=-nolisten tcp
in kdmrc

This is usually somewhere like: /etc/kde4/kdm/kdmrc or /etc/kdm/kdmrc
 
  


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
"Keep laptop running on lid close?" + "ssh via crossover cable?" FatalKeystroke Linux - Laptop and Netbook 7 03-11-2011 07:53 AM
"NIM thread blocked" & "Deadman Switch (DMS) close to trigger" errors sosborne Linux - Networking 1 06-28-2006 02:07 PM
How to close port 6000? WilliamS Slackware 12 03-02-2005 12:27 PM
help close port 6000 ronin4601 Linux - Newbie 6 04-23-2004 03:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:48 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