LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-23-2003, 07:33 AM   #1
pixelV
Member
 
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123

Rep: Reputation: 15
Arrow close all my ports


my open ports on Slack 8.1:

Port State Service
25/tcp open smtp
111/tcp open sunrpc
587/tcp open submission
6000/tcp open X11



How can i close all ports ?
 
Old 02-23-2003, 07:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
use a firewall
 
Old 02-23-2003, 07:43 AM   #3
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
Well, I do not know about the last two, but the first two are porgrams that are started from /etc/rc.d/rc.inet2. If you edit the file and remark out sendmail and the sun rpc server stuff it will prevent them starting up when you boot. You can just terminate the processes by killing the process ID. You can use "gtop" to list all the processes and then right click the desired task and send the SIGKILL message.

The X11 port may be for X11 forwarding. But you should also check your /etc/inetd.conf file. I normally remark out everything except the two items that start with "time" very near the top of the file.

Perhaps someone else knows about 587 and 6000 ports.
 
Old 02-23-2003, 08:07 AM   #4
Proud
Senior Member
 
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794

Rep: Reputation: 116Reputation: 116
Maybe someone should say that: if you dont need services like SMTP for emailing, then you can turn them off; but if you want to use them, you'll need to allow them to access the internet via their ports.
A firewall will close ports.
 
Old 02-23-2003, 08:10 AM   #5
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
For the last one if you startx from a command you would want to do this:

startx -- -nolisten tcp

If you X starts up at bootup do this:

assuming you use GDM:
Edit file: /etc/X11/gdm/gdm.conf
Make following changes:
.....
StandardXServer=/usr/X11R6/bin/X -nolisten tcp

[server-Standard]
.......
command=/usr/X11R6/bin/X -nolisten tcp

If using KDM or any other, I'm sure its similiar to that above.

The open port 587 could be anything. Like if you use Instant Messaging or whatever, but that isn't a standard port for a particular app. Most likely some app you have requires that port open. But I would take acid's advice, use a firewall of some sort.
 
Old 02-23-2003, 08:13 AM   #6
fskmh
Member
 
Registered: Jun 2002
Location: South Africa
Distribution: Custom slackware64-current
Posts: 307

Rep: Reputation: 92
You can disable tcp connections to X (6000), but this tends to break things, especially if you set up a home network later on. Judging from the presence of the rpc service, It appears that you have that planned. Sort out your /etc/hosts.deny and /etc/hosts.allow if you intend to do NFS with it. Then get yourself a firewall script from http://www.linuxguruz.org/iptables and you'll be off to a good start. The "Firewall by Jim" package is quite comprehensive (no, I'm not Jim ;-p). http://www.jg555.com/projects/firewall/download.php
http://www.insecure.org is a useful resource of information, and there are also other projects worth looking into, like Nessus and snort.
 
Old 02-23-2003, 08:21 AM   #7
pixelV
Member
 
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123

Original Poster
Rep: Reputation: 15
OK

OK, but i still have those ports open:

25/tcp open smtp
587/tcp open submission

I have a question ---> If i will close 25 port, could i than send email ?
 
Old 02-23-2003, 09:38 AM   #8
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
Which MTA (mail transport agent) are you using?

Exim
Postfix
Sendmail


Well I wouldn't recommend completely disabling the mail server since this would break things. Rather just make it listen on 127.0.0.1
 
Old 02-23-2003, 01:47 PM   #9
pixelV
Member
 
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123

Original Poster
Rep: Reputation: 15
i'm using sendmail

where i can config my MTA ?
 
Old 02-23-2003, 02:28 PM   #10
Excalibur
Senior Member
 
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180

Rep: Reputation: 46
Try the /etc/rc.d/rc.sendmail file. At the very beginning is the start function. If you only want to use sendmail for outbound and NOT inbound then remark the first instance. Leave the queue runner module running. At least I think it will produce the desired results. It should close the port 25 for inbound mail but still allow outbound mail to be sent out on port 25.




Last edited by Excalibur; 02-23-2003 at 02:31 PM.
 
Old 02-23-2003, 03:40 PM   #11
Astro
Member
 
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665

Rep: Reputation: 30
Try editing /etc/inetd.conf to which services you want to allow to run by inetd.
 
Old 02-24-2003, 05:53 AM   #12
pixelV
Member
 
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123

Original Poster
Rep: Reputation: 15
Smile

i have already comment all in inetd.conf

i think it would be better if i start using firewall ?

what firewall you recomend ?

please write two typs of firewall:
1. easy to config
2. good secure

And it will be better if you help me find easy and secure firewall.

Thanks a lot !
 
Old 02-24-2003, 03:24 PM   #13
wass29
Member
 
Registered: Feb 2003
Distribution: Slack 9,10 Ubuntu 8.04-current RHEL4(sort of)
Posts: 63

Rep: Reputation: 15
I also am looking for easy and secure firewall so if anyone has any ideas I am listening.

I saw a bunch of them at Tucows but did not want to try something I'd never heard of.
 
Old 02-24-2003, 05:48 PM   #14
Texicle
Member
 
Registered: Oct 2002
Location: Northern Ontario, Canada
Distribution: Slackware 10.0
Posts: 789

Rep: Reputation: 30
This quick iptables will pretty much drop everyone trying to connect to your TCP ports. Run it as root.

/sbin/iptables -A INPUT -p tcp --syn -j DROP

I've got this one running at home, though I'm sure there's many other ways to secure your box but this one is a good start until you get other scripts to try. Hope this helps.

EDIT: I got it from this website called 10 minutes to an iptables-based Linux firewall. I think you'll find lots of good stuff there. Good luck!

Last edited by Texicle; 02-24-2003 at 05:50 PM.
 
Old 03-23-2004, 09:22 PM   #15
Sn1PeR
LQ Newbie
 
Registered: Sep 2003
Posts: 26

Rep: Reputation: 15
Quote:
Originally posted by Excalibur
Try the /etc/rc.d/rc.sendmail file. At the very beginning is the start function. If you only want to use sendmail for outbound and NOT inbound then remark the first instance. Leave the queue runner module running. At least I think it will produce the desired results. It should close the port 25 for inbound mail but still allow outbound mail to be sent out on port 25.

What would you comment out?


#!/bin/sh
# Start/stop/restart sendmail.

# Start sendmail:
sendmail_start() {
if [ -x /usr/sbin/sendmail ]; then
echo "Starting sendmail MTA daemon: /usr/sbin/sendmail -L sm-mta -bd -q25m"
/usr/sbin/sendmail -L sm-mta -bd -q25m
echo "Starting sendmail MSP queue runner: /usr/sbin/sendmail -L sm-msp-queue -Ac -q25m"
/usr/sbin/sendmail -L sm-msp-queue -Ac -q25m
fi
}

# Stop sendmail:
sendmail_stop() {
killall sendmail
}

# Restart sendmail:
sendmail_restart() {
sendmail_stop
sleep 1
sendmail_start
}

case "$1" in
'start')
sendmail_start
;;
'stop')
sendmail_stop
;;
'restart')
sendmail_restart
;;
*)
echo "usage $0 start|stop|restart"
esac


I've got mine down to

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )
Interesting ports on localhost (127.0.0.1):
(The 1598 ports scanned but not shown below are in state: closed)
Port State Service
22/tcp open ssh
25/tcp open smtp
587/tcp open submission


the submission is the one that no one knows about.
 
  


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
How to Close Ports janderson622 Linux - Security 21 01-04-2007 05:59 PM
Which of these ports can I close? buddhahat Linux - Security 6 06-13-2005 07:40 AM
how to close ports hudy Linux - Security 4 06-23-2004 12:07 PM
How do I close ports ksgill Linux - Newbie 9 10-09-2003 09:06 PM
how do i close ports. KidTonz Linux - Security 3 12-18-2001 02:43 AM

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

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