LinuxQuestions.org
Review your favorite Linux distribution.
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 10-18-2003, 09:25 PM   #1
mymojo
Member
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Rep: Reputation: 30
Newbie here: Are these ports ok to have open?


PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
111/tcp open rpcbind
631/tcp open ipp
6000/tcp open X11


this is a personal desktop computer - how do I close ones I don't need open? is this relatively secure?
 
Old 10-18-2003, 10:23 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
If you do not work as a mail server you should close the smtp-port.
And even if you want to deliver mail directly, you should check that your computer doesn't work as an open relay.

111 is used by remote portmapper most commonly seen in nfs. If you don't want tho
have nfs exports, you should close this port too.

631 is used to access your printing system. If you don't want to do that from the internet, you should also close this port.

6000 gives a way to communicate with your X server from outside world. If you don't want that, you should close the port.


How to close a port? Either shutdown the service listening to the port or use iptables
to prevent traffic to the port from outside.

example:
Prevents all the connections to all ports except the ones you have established from your side (that is, for example, you request a web page(by clicking a link in the browser) and they send you one), local loopback connections and the ssh port:
Code:
iptables --flush
iptables --policy INPUT DROP
iptables --append INPUT --in-interface lo -j ACCEPT
iptables --append INPUT --in-interface eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables --append INPUT --in-interface eth0 -p tcp --destination-port ssh -j ACCEPT
Other example:
Blocks the connnections to port 25/smtp from the ethernet device eth0
Code:
iptables --append INPUT --in-interface eth0 -p tcp --destination-port smtp -j REJECT
What comes to the security issues, if all those services are properly configured,
they can be secure in a functional sense. Though I wouldn't use nfs or X11 over internet
(without ssh tunneling) because they are totally unencrypted and nfs has some design
issues.
 
Old 10-18-2003, 10:33 PM   #3
mymojo
Member
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Original Poster
Rep: Reputation: 30
Thanks!

Do these permenantly block the ports (not just current session)?
 
Old 10-19-2003, 04:41 AM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
iptables will block it as long as the kernel module is loaded. If you reboot and you don't have those commands in your init scripts, or if you remove the iptables module from the kernel, you will lose the rules.

A better solution would be to disable portmapper, unless you're exporting nfs mounts. There is probably a init script for it in /etc/rc.d/something. For IPP, that is probably being made available by CUPSd. Read the CUPS documentation for how to make it bind only to local interfaces (or add an ACL to the CUPS config file to disallow any IPs that aren't on your LAN). For X11 you want to put the tcp nolisten option in your configuration.
 
Old 10-19-2003, 10:22 AM   #5
MsMittens
Member
 
Registered: Oct 2003
Location: Canada
Distribution: depends on the mood -- these days.. Slack!
Posts: 44

Rep: Reputation: 15
This might help as well. Firewall is the first defense but closing or turning off services that do not need network access is the other:

http://jetblackz.nabaza.org/Removing...icesTools.html
 
Old 10-19-2003, 05:59 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
IMHO I would turn that around and say removing unnecessary SW is the first line of defense. Application config based, libwrap and firewall ACL's next and blocking fw rules last.
 
Old 10-19-2003, 06:14 PM   #7
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
that's right, your security as only as strong as it's weakest link, so anything you can do to protect your computer is good, and if you don't use the services that run on those ports then by all means close them...
 
Old 10-20-2003, 04:09 AM   #8
mymojo
Member
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Original Poster
Rep: Reputation: 30
Excellent, I want to have a relatively secure linux system, any URLS you've stumbled across that describe the basics and advanced concepts of securing your desktop (not server stuff - I don't swing that way) please post.

Any way of keeping up-to-date with new software patches?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Cannot Open Mail Server Ports 25, 110, and 220. Other Ports will open. Binxter Linux - Newbie 9 11-29-2007 02:03 AM
open ports on linksys, i have ssh open but thats it PlatinumRik Linux - Security 1 07-07-2005 10:38 AM
i need to open some ports, how can i do it? israel Linux - Software 2 08-26-2003 05:47 PM
open ports jstu Linux - Security 4 02-07-2002 12:15 AM
OPen ports Stephanie Linux - General 1 08-17-2001 10:24 PM

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

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