[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1528
  • Last Modified:

How Do I Unlock Debian / Ubuntu so I can open up port 25 connections (send and receive) and so taht I can bind sockets to local ips?

Hello,
I am an application developer using netbeans on ubuntu 7.10... I am writing an application which requires me to be able to open up and listen on port 80, and on port 25. Whenever I try to listen on these ports I am told they are in use by the operating system and the exception that is thrown in java, however, I dont have apache installed nor do I have sendmail or postfix installed. I have checked thoroughly through the package manager looking for a web service or mail service and there is nothing. So my next th0ought was maybe theres some policy in iptables, so I shut iptables down, and nothing. Then I removed iptables completely and still nothing.

Can someone please tell me how to clear these ports, and limitations so that I can listen on these ports, and bind sockets to local IP addresses?

Worth 500 points.

Thanks,
Rick
0
richardsimnett
Asked:
richardsimnett
3 Solutions
 
Rance_HallCommented:
Is the app running as root?  if not you will have trouble binding to the low numbered ports even if no other service is using them.  Its a linux security thing, root needs to bind to the low numbered ports.

There are a host of tools out there to check to see if a service is running on a port, have you made sure that NO OTHER service is using the ports you want to use.

0
 
alextoftCommented:
Are you running the application as root?
0
 
omarfaridCommented:
You may run

lsof -i4:25
lsof -i4:80

this will give you process name and process id that is listening on port 25 and 80

Then you may find the startup script for that application and disable it.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
richardsimnettAuthor Commented:
I am not running as root. I am running as my username rick in gnome.. I can sudo in a terminal session.

Thanks,
Rick
0
 
richardsimnettAuthor Commented:
omarfarid,
there are no processes listed at all with those commands, except for a few outbound firefox connections.

Thanks,
Rick
0
 
omarfaridCommented:
Ok, if you want to test your self, then try

telnet 0 25
telnet 0 80

If you get connection refused message it means that no process is running that is listening.

For you to be able to run applications that listen to ports below 1024 , you need to be root. So

 su - root

then start the applications
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now