Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
02-23-2003, 07:33 AM
|
#1
|
Member
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123
Rep:
|
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 ?
|
|
|
02-23-2003, 07:41 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
use a firewall
|
|
|
02-23-2003, 07:43 AM
|
#3
|
Senior Member
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180
Rep:
|
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.
|
|
|
02-23-2003, 08:07 AM
|
#4
|
Senior Member
Registered: Dec 2002
Location: England
Distribution: Used to use Mandrake/Mandriva
Posts: 2,794
Rep: 
|
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.
|
|
|
02-23-2003, 08:10 AM
|
#5
|
LQ Guru
Registered: Jan 2001
Posts: 24,149
|
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.
|
|
|
02-23-2003, 08:13 AM
|
#6
|
Member
Registered: Jun 2002
Location: South Africa
Distribution: Custom slackware64-current
Posts: 308
Rep:
|
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.
|
|
|
02-23-2003, 08:21 AM
|
#7
|
Member
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123
Original Poster
Rep:
|
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 ?
|
|
|
02-23-2003, 09:38 AM
|
#8
|
Senior Member
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467
Rep:
|
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
|
|
|
02-23-2003, 01:47 PM
|
#9
|
Member
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123
Original Poster
Rep:
|
i'm using sendmail
where i can config my MTA ?
|
|
|
02-23-2003, 02:28 PM
|
#10
|
Senior Member
Registered: Jun 2002
Location: Northern VA, USA
Distribution: Ubuntu
Posts: 1,180
Rep:
|
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.
|
|
|
02-23-2003, 03:40 PM
|
#11
|
Member
Registered: Jan 2003
Location: Ballston Lake, NY
Distribution: Slackware, Debian
Posts: 665
Rep:
|
Try editing /etc/inetd.conf to which services you want to allow to run by inetd.
|
|
|
02-24-2003, 05:53 AM
|
#12
|
Member
Registered: Dec 2002
Distribution: Slackware 8.1
Posts: 123
Original Poster
Rep:
|
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 !
|
|
|
02-24-2003, 03:24 PM
|
#13
|
Member
Registered: Feb 2003
Distribution: Slack 9,10 Ubuntu 8.04-current RHEL4(sort of)
Posts: 63
Rep:
|
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.
|
|
|
02-24-2003, 05:48 PM
|
#14
|
Member
Registered: Oct 2002
Location: Northern Ontario, Canada
Distribution: Slackware 10.0
Posts: 789
Rep:
|
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.
|
|
|
03-23-2004, 09:22 PM
|
#15
|
LQ Newbie
Registered: Sep 2003
Posts: 26
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 02:31 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|