Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing Open Port at Linux

Status
Not open for further replies.

warik

Programmer
Jun 28, 2002
169
ID
Dear,

I try to scan my server using nmap myserver, and it shown an unknown port 757/tcp.

So, what should I do to close that port. I try to delete that port from /etc/services, but I can not find port 757 there.

Anyone can give me idea to close that port at my linux server.

Thank you in advance.

::Warik?::
 
Use 'lsof -i tcp:757' or 'netstat -pta |grep 757'. It will show you the name of the process that listens on this port. Then you should decide if you want to keep it running or not.
 
Dear Pupu,

Right, I could now saw the service run at 757 port. Thank you.

If I would like to close that port, what should I do?

thank's
 
Stop this service. If the service is not running, then the port is closed.

Or, you can 'close' the port for outside by implementing firewall. I don't know if you are using ipchains, iptables or even have no firewall at all (try to issue iptables -L -n, for example), but you can do it like this:

iptables -A INPUT -i eth+ -p tcp -m tcp -s 0.0.0.0/32 -d <your_ip_address>/32 --dport 757 -j REJECT --reject-with icmp-host-prohibited

I strongly suggest reading some HOWTOs and man pages between diving deeper into this.
 
Ok, now, I know how to solve that problem.

Thank's a lot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top