LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-27-2009, 11:04 AM   #1
xeonx
LQ Newbie
 
Registered: May 2009
Posts: 6

Rep: Reputation: 0
Port related commands


hi
i am looking for a commands which gives me info about which ports are open and which services are running on them.And how to close ports
 
Old 05-27-2009, 11:17 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
man netstat
 
Old 05-27-2009, 02:31 PM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
You might cruise google for netstat(8) tutorials. (I find netstat's manpages to be slightly obtuse.)

Also check out lsof(8). For example, to view IPv4 listening ports and connections:

# lsof -i4

"Closing" ports is another matter. The best approach is to shut down the service associated with the listening port (if it's not legitimately needed). Another approach is to set up packet filtering rules to block or otherwise manage connections.

Last edited by anomie; 05-27-2009 at 02:32 PM.
 
Old 05-27-2009, 08:21 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Please add your distro and version to your profile for better answers.
iptables is what you need to research for your firewall/ports.
Most GUIs have a menu item to show/ctrl services, but we need your distro name...
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Traffic Spike Related To Port Scan? bbonifield Linux - Security 9 06-20-2007 04:15 PM
vpn, voip and port related question tusher General 1 11-15-2006 01:10 PM
VPN/Voip port related question. voice_route66 Linux - Networking 0 11-13-2006 05:53 PM
A confused newbie - startx and other related commands Godsmacker777 Linux - Newbie 2 01-27-2005 12:40 PM
System Related Commands shivprasad Linux - Certification 1 09-16-2004 08:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:23 PM.

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