HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Block a port for localhost

 
Arun Jain
Frequent Advisor

How to Block a port for localhost

Hi All,

I have certain ports blocked on the Intranet Firewall, so that no body from outside could connect to server.

But I can connect localhost through that (telnet localhost ). I need to know that how I can block/disable the port on the server so that it could not be connected through localhost itself.

Best Regards
Arun Jain
speak less say more
5 REPLIES
Jupinder Bedi
Respected Contributor

Re: How to Block a port for localhost

to block or unblock you can use etc/services /etc/inetd.conf file


and than run inetd -c
All things excellent are as difficult as they are rare
Johnson Punniyalingam
Honored Contributor

Re: How to Block a port for localhost

does the your refering added in your /etc/services ??

you can use /var/adm/inetd.sec to "deny" telnet

man inetd -> for more information


Problems are common to all, but attitude makes the difference
Horia Chirculescu
Honored Contributor

Re: How to Block a port for localhost

Hello,

Just wanted to point this:

>to block or unblock you can use etc/services /etc/inetd.conf file


From man page:

"The inetd daemon is the Internet superserver, which invokes Internet server processes as needed"

Along with other stand-alone daemons, the from the above definition opens the ports that are opened on the server.

To block a port you must use a firewall rule on the server. In order to stop the process(es) you modify the inetd.conf file. But this means that the processes will be dead after removing the corresponding line from inetd configuration file (and of course restarting the inetd daemon). Dead processes do nothing for anyone regardless the location from where he would want to access that process(es) - localhost or not.


Horia.
Best regards from Romania,
Horia.
Steven Schweda
Honored Contributor

Re: How to Block a port for localhost

> [...] how I can block/disable the port [...]

Which port are you trying to block? (I
assume that, when you say "block/disable the
port", you really wish to disable one or more
_services_.)


> to block or unblock you can use
> etc/services /etc/inetd.conf file

PLEASE give "/etc/services" a rest. Editing
it is more likely to cause trouble than to do
anything useful.
Torsten.
Acclaimed Contributor

Re: How to Block a port for localhost

Just make sure there is *nothing* listening to that port (whatever this port is ...?).

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!