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 05-31-2007, 10:09 PM   #1
hottdogg
Member
 
Registered: Aug 2004
Distribution: opensuse ,debian/ubuntu
Posts: 222

Rep: Reputation: 30
should port 6000 be opened?


I run nmap localhost to my slackware 11.0.
Code:
PORT     STATE SERVICE VERSION
22/tcp   open  ssh     OpenSSH 4.4 (protocol 1.99)
37/tcp   open  time?
113/tcp  open  ident   OpenBSD identd
631/tcp  open  ipp     CUPS 1.1
6000/tcp open  X11      (access denied)
one thing that intrigues me is port 6000. I use X (KDE) when I'm using my slackware but I don't use my slackware as an X server for other user.
my questions are:
why it's open?
Whilst in my co-workers' slackware 11.0 there's NO port 6000 open...
(yes, they're using X just for their own computer also).
How to close it?

Tnx
 
Old 05-31-2007, 10:22 PM   #2
Ilgar
Senior Member
 
Registered: Jan 2005
Location: Istanbul, Turkey
Distribution: Slackware64 15.0, Slackwarearm 14.2
Posts: 1,157

Rep: Reputation: 237Reputation: 237Reputation: 237
It's probably XDMCP, used for remote X connections. You can turn it off by putting

DisplayManager.requestPort: 0

in /etc/X11/xdm/xdm-config if you're using XDM as the login manager. If it's kdm, I think the file is

/opt/kde/share/config/kdm/kdmrc

and you should set

[Xdmcp]
Enable=false

But XDMCP should've been turned off by default, did you enable it manually?
 
Old 05-31-2007, 10:50 PM   #3
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Code:
sed -i 's/^serverargs=""/serverargs="-nolisten tcp"/' $(which startx)
Then restart X... ligar is right, it's used for remote x-windows sessions... I'd like to see this turned off by default personally.

Last edited by jong357; 05-31-2007 at 10:54 PM.
 
Old 06-01-2007, 02:31 AM   #4
pdw_hu
Member
 
Registered: Nov 2005
Location: Budapest, Hungary
Distribution: Slackware, Gentoo
Posts: 346

Rep: Reputation: Disabled
No, just close it.
 
Old 06-01-2007, 06:46 AM   #5
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Rather than running "startx" to start the xserver run :
Code:
startx -- -nolisten tcp
to stop the X server listening on 6000. You may then alias startx to reflect this change if you wish.
 
Old 06-01-2007, 07:36 AM   #6
lali.p
Member
 
Registered: Jan 2007
Distribution: Slackware 11.0
Posts: 141

Rep: Reputation: 16
search for the file startx in ur pc using slocate command or other serach utility like find.

i think startx should be in /usr/X11R6/bin

in that file where its written serverargs=""
change it to serverargs="-nolisten tcp"

Last edited by lali.p; 06-01-2007 at 07:37 AM.
 
Old 06-01-2007, 07:58 AM   #7
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Not meaning to split hairs here but I would tend to alias the "startx" script to "startx -- -nolisten tcp" for several reasons. 1) You are not altering a standard script which may be overwritten when updgrading/reinstalling something. 2) The original functionality if the script is preserved. 3) Different functionality may given to some users by having their own environment (i.e. some users have the alias, others don't. 4) It can become difficult to keep track of "customizations" to the original Slackware settings, keeping them (as aliases) in /etc/profile.d or ~/.bashrc keeps system wide/local settings in two easily maintainable places. This is much like a lot of the rc.d scripts source .conf files so the original script may be left intact. Others may disagree - there's more than one way to skin a cat !! Just a few ideas anyway..

Cheers.
 
Old 06-01-2007, 09:42 AM   #8
d-ra
LQ Newbie
 
Registered: Jul 2006
Posts: 6

Rep: Reputation: Disabled
I had the same problem and because of this reason
Quote:
Originally Posted by bgeddy
... 1) You are not altering a standard script which may be overwritten when updgrading/reinstalling something. ...
I have choosen the following solution:

/etc/X11/xinit/xserverrc
Code:
#!/bin/sh
exec /usr/bin/X -nolisten tcp
The file /etc/X11/xinit/xserverrc is not included in the slackware installation, so no problems when updateing xorg server.
 
1 members found this post helpful.
Old 06-01-2007, 11:52 AM   #9
jong357
Senior Member
 
Registered: May 2003
Location: Columbus, OH
Distribution: DIYSlackware
Posts: 1,914

Rep: Reputation: 52
Yea, good point with the alias bgeddy. I'm the only user on my computer and I'll never need or want that port open so that's how I choose to handle it. An alias would be more "proper". Especially if this were at work, like I think the OP is suggesting. To the OP, I'm fairly certain that the global and local bashrc file won't get read on login shells and I don't know if you can define an alias in the global or local profile files. A ~/.bash_profile sourcing ~/.bashrc which in turn contains:

alias startx='startx -- -nolisten tcp'

aught to work. Someone correct me if I'm mistaken. Defining said alias in /etc/bashrc would defeat the purpose of keeping it user based....

@pdw_hu, Judging from your short and slightly unhelpful post, I'm assuming you mean to block traffic on that port via a firewall script?

iptables -A INPUT -p ALL -i $INTERFACE --dport 6000 -j DROP

Not too much point in doing that. 1.) Last I checked, Slackware doesn't come with a firewall script so you'd have to spend some time setting one up. 2.) Why even have the port listen at all if your not going to use it?

Last edited by jong357; 06-01-2007 at 12:19 PM.
 
Old 06-01-2007, 01:05 PM   #10
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Oops - sorry about possibly misleading you with the ~/.bashrc. I have my ~/bash_profile set up to source the ~/.bash_rc if it exists and store all my aliases in the ~/.bashrc. (I was forgetting that my ~/.bash_profile was set to source the ~/.bashrc on my setup. So much to my extolling the virtues of standard Slackware setups !). However at least you spotted it !

So - in a nutshell : as you said..

Code:
A ~/.bash_profile sourcing ~/.bashrc which in turn contains:

alias startx='startx -- -nolisten tcp'

aught to work. Someone correct me if I'm mistaken. Defining said alias in /etc/bashrc would defeat the purpose of keeping it user based....
and yes, anything in /etc defeats the object of being user based. Phew - I think we got there in the end...
 
  


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
Strange port opened ivanatora Linux - Security 4 11-11-2003 10:57 AM
how is a tcp port opened? Kayaker Linux - Security 7 05-12-2003 12:47 AM
port 6000 pottsie Linux - Security 6 04-23-2003 04:06 AM
Can port 25 be opened without a SMTP server installed? greenranger Linux - Networking 2 04-05-2003 05:26 PM
Port 6000 sitrus Linux - Security 4 12-15-2001 03:25 AM

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

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

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