LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   open and close network port (https://www.linuxquestions.org/questions/linux-security-4/open-and-close-network-port-219621/)

abd_bela 08-19-2004 06:26 AM

open and close network port
 
Hi, every body
Please someone can tell me how to open and close a network port. for example I want to close port 25 (smtp) and open another for the same process (smtp)

thank you in advance
bela

ppuru 08-19-2004 06:52 AM

what mail software do you use? You can certainly do it by making appropriate changes in the config files.

abd_bela 08-19-2004 09:16 AM

Thank you,
I want only to know how to oepn and close the port.

For example the netstat -l gives all the listenning port on network
thank you

barisdemiray 08-19-2004 09:53 AM

Quote:

Originally posted by abd_bela
Thank you,
I want only to know how to oepn and close the port.

For example the netstat -l gives all the listenning port on network
thank you

If you want to close a port completely, simply kill the daemon which listens that port. For example if you don't use the SSH service, kill the sshd daemon and prevent it from running at boot. But if you want to block specific traffic like blocking all the SSH requests that comes from out of the internal network (or from a specific IP) then use a packet filter tool like netfilter.

abd_bela 08-19-2004 02:20 PM

Ok thank you ,
Now I want to open a new port and assign it to some daemon.

or suppose that the the 25 port is block for an unknown reason, so I want to assign to the smtp a new value and open it of course for traffic

thank you
bela

barisdemiray 08-19-2004 03:40 PM

Quote:

Originally posted by abd_bela
Ok thank you ,
Now I want to open a new port and assign it to some daemon.

or suppose that the the 25 port is block for an unknown reason, so I want to assign to the smtp a new value and open it of course for traffic

thank you
bela

Then follow the ppuru's way and edit some configuration file. Most of the server daemon's configuration files has an option for a user-defined port to listen. You can find this specific information in your mail transport agent's documentation.


All times are GMT -5. The time now is 07:20 PM.