Operating System - HP-UX
1748181 Members
3568 Online
108759 Solutions
New Discussion юеВ

Re: 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 5
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!