LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to open and close ports on command line ? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-open-and-close-ports-on-command-line-619609/)

uncle-c 02-08-2008 08:44 AM

How to open and close ports on command line ?
 
Hello there,
I have no firewall installed on a linux box and after running nmap have found that there are three open ports

Code:

[root@PCLOS2007 ~]# nmap 127.0.0.1

Starting Nmap 4.20 ( http://insecure.org ) at 2008-02-08 14:25 GMT
Interesting ports on PCLOS2007 (127.0.0.1):
Not shown: 1694 closed ports
PORT    STATE SERVICE
22/tcp  open  ssh
139/tcp open  netbios-ssn
445/tcp open  microsoft-ds

AS I am not running iptables etc, just for curiosity's sake,
what would be the best way to open and close ports via command line ?
One could edit the inetd.conf file but this is becoming redundant in a lot of Linux flavours.
I would like to open port 79 so that I can finger from another machine.Is there a manual way of opening / close this port or is the port opened by the finger daemon at start-up ?

Thanks again,

uc.

Matir 02-08-2008 10:23 AM

An "open" port is created by the service running on that port performing the listen() call to listen for incoming requests.


All times are GMT -5. The time now is 06:54 AM.