LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 07-02-2003, 10:35 PM   #1
zerojosh
LQ Newbie
 
Registered: Jun 2003
Distribution: RH8
Posts: 9

Rep: Reputation: 0
which ports can i close on a home desktop? all?


i'm running rh8 on my home computer. this is simply my main pc for home computing with no fancy server activity. i simply want to be able to run my browser, ftp software, messenger, file sharing progs, etc. i don't want anything coming into my linux box other than what is necessesary.

where can i find out which ports are open, and which ones i can close?

thanks for the help
 
Old 07-02-2003, 10:43 PM   #2
shellcode
Member
 
Registered: May 2003
Location: Beverly Hills
Distribution: Slackware, Gentoo
Posts: 350

Rep: Reputation: 32
issue the command

netstat -nl

and look for the listening connections.

If you really dont want any of those servers then you can close their ports....look into inetd or possible xinetd.

have fun.
 
Old 07-03-2003, 04:12 AM   #3
mOve`iT
LQ Newbie
 
Registered: Jun 2003
Posts: 4

Rep: Reputation: 0
hio

first you run the netstat command to look for listning ports
"netstat -ant"
"netstat -plut"
(also u can look for open connections use "socklist")
now u can close all unused ports in /etc/inetd.conf
(check inetd with this "grep -v ^# /etc/inetd.conf")
for all other things u can stop unused services with
chkconfig or normally the better way is u uninstal it
when u want to make secure ure computer install iptables
a statefull inspection firewall at http://www.netfilter.org/
also look at www.chkrootkit.org for local sec

if u dont know which port is for which services check /etc/services
or look at www.snort.org at there portdatabase

i it helps greets
(sry for my english)
 
Old 07-03-2003, 04:26 AM   #4
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
On my machine I have very very few ports open; if you don't have any internet connectivity (and don't need it), you probably don't need to have any ports open
 
Old 07-03-2003, 02:01 PM   #5
cyberskye
Member
 
Registered: Feb 2003
Location: The City by the Bay
Posts: 116

Rep: Reputation: 15
ports are only 'open' because software is listening on them for inbound activity. If you don't run any servers, no ports will be open (filesharing is a service and a fairly dangerous one, too).

Rather than 'closing ports' (I assume you mean at the fw level) why not eliminate all services?
 
Old 07-03-2003, 05:09 PM   #6
zerojosh
LQ Newbie
 
Registered: Jun 2003
Distribution: RH8
Posts: 9

Original Poster
Rep: Reputation: 0
i tried editing the services at runlevel 3,4,5, but some are still running. i'm unsure of which i can and can not close.

i just checked netstat, and i must have at least 30 ports open. A lot of them are STREAMS? and all Paths are to /etc. Is this good or bad?
 
Old 07-03-2003, 05:56 PM   #7
cyberskye
Member
 
Registered: Feb 2003
Location: The City by the Bay
Posts: 116

Rep: Reputation: 15
check to see if xinetd is still starting at boot. It will launch certain other services as needed and could be why you're seeing stuff running.
 
Old 07-06-2003, 07:31 PM   #8
dogn00dles
Member
 
Registered: Feb 2003
Distribution: Slack 9.0/NetBSD
Posts: 101

Rep: Reputation: 15
Red face

Just comment out everything you don't need running in /etc/rc.d/ and
/etc/inetd.conf or /etc/xinetd.conf

If having the X11 port open makes you queasy run "startx -- -nolisten tcp"

Good luck!
 
  


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
How can I close ports? nectron101 Linux - Networking 3 11-27-2004 11:22 PM
How do I close ports ksgill Linux - Newbie 9 10-09-2003 09:06 PM
Ports, and how to close them? davee Linux - Networking 2 07-24-2003 08:10 AM
how do i close ports. KidTonz Linux - Security 3 12-18-2001 02:43 AM

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

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