nixCraft Linux / UNIX / Shell Scripting Forum

nixCraft

Linux / UNIX Tech Support Forum

How can I close unnecessaries ports ?

This is a discussion on How can I close unnecessaries ports ? within the CentOS / RHEL / Fedora forums, part of the Linux Distribution category; Hi, I have just working with linux (CentOS 5.2) I have seen around ten of ports are unwanted ports and ...


Register free or login to your account to remove all advertisements.

Go Back   nixCraft Linux / UNIX / Shell Scripting Forum > Linux Distribution > CentOS / RHEL / Fedora

Linux answers from nixCraft.


CentOS / RHEL / Fedora Discussion about Redhat Enterprise Linux or CentOS or Fedora Linux related problems.

Reply

 

Thread Tools Display Modes
  #1 (permalink)  
Old 16th July 2009, 03:03 PM
Junior Member
 
Join Date: Jul 2009
OS: CentOS
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
naruponk is on a distinguished road
Default How can I close unnecessaries ports ?

Hi,

I have just working with linux (CentOS 5.2)
I have seen around ten of ports are unwanted ports and need to be closed.
How can I close those port via command line ?
Reply With Quote
  #2 (permalink)  
Old 16th July 2009, 03:17 PM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,195
Thanks: 13
Thanked 394 Times in 292 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

Turn off service using service and chkconfig command:
Code:
service srvname stop
chkconfig srvname off
You can also use ntsysv:
Code:
ntsysv
To list service name and open port use:
Code:
netstat -tulpn
See Red Hat / CentOS: Check / List Running Services
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
  #3 (permalink)  
Old 16th July 2009, 03:35 PM
Junior Member
 
Join Date: Jul 2009
OS: CentOS
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
naruponk is on a distinguished road
Default

Thanks ! This is what I want

I still have some problem

Xvnc 5801
Xvnc 5901

There are same service name
I would like to close Xvnc for 5801 while still open Xvnc for 5901
how can I do that ?
Reply With Quote
  #4 (permalink)  
Old 16th July 2009, 04:04 PM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,195
Thanks: 13
Thanked 394 Times in 292 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

Use firewall to keep one port open for same service while other is closed. Xvnc opens port per user session. So only firewall will help you. See
Redhat / CentOS / Fedora Linux Open Port

Be careful with firewall, if you are working on remote server over ssh, you may lockdown yourself. Instead of accept use DROP target to block port.
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog

Last edited by nixcraft; 16th July 2009 at 04:06 PM.
Reply With Quote
Reply

Tags
centos close ports, chkconfig, iptables, iptables close ports, redhat close ports, rhel close ports, service


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Squid Mdaemon Ports ngalye Linux software 2 21st January 2009 10:49 AM
Freebsd Ports raj All about FreeBSD/OpenBSD/NetBSD 1 29th August 2008 09:40 AM
Open Mail Ports B!n@ry Linux software 31 29th December 2006 02:19 AM
How to close the tasks? jithendra Linux software 3 17th November 2006 08:59 AM
Blocking ports in linux raj Linux software 1 10th July 2006 07:31 PM


All times are GMT +5.5. The time now is 08:57 PM.


Powered by vBulletin® Version 3.8.6 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40