How to bind to a port <=1024 ?

How to bind to a port <=1024 ?

Post by Brian Rank » Tue, 09 Jan 1996 04:00:00



I've written a C program which binds to a port and displays an
HTML page.  However it doesn't seem to function when I use a port
<= 1024.  Why is this?  Is there a way of bypassing this restriction?

Sincerely,

Brian Rankin

 
 
 

How to bind to a port <=1024 ?

Post by Jesse M. Hammo » Tue, 09 Jan 1996 04:00:00




>I've written a C program which binds to a port and displays an
>HTML page.  However it doesn't seem to function when I use a port
><= 1024.  Why is this?  Is there a way of bypassing this restriction?

Brian,

ports <= 1024 are can only be used by programs with root permissions.
So you either have to login as root (if you can do that) or ask the
SysAdmin to set you program up so it is suid root (no likely)

-Jesse

 
 
 

How to bind to a port <=1024 ?

Post by Robert Kl » Wed, 10 Jan 1996 04:00:00



 >I've written a C program which binds to a port and displays an
 >HTML page.  However it doesn't seem to function when I use a port
 ><= 1024.  Why is this?  Is there a way of bypassing this restriction?

Port-numbers below 1024 are reserved for superuser. Either run your
program as root, make it suid root (be careful with that) or pick a port

Quote:> 1024.

                                                                robert
 
 
 

How to bind to a port <=1024 ?

Post by Gregg E Econom » Tue, 16 Jan 1996 04:00:00




>I've written a C program which binds to a port and displays an
>HTML page.  However it doesn't seem to function when I use a port
><= 1024.  Why is this?  Is there a way of bypassing this restriction?

Are you running this program with setuid 0?
root has privelege to ports below 1024. THe simplest solutions are:
a: use a higer port (>6000 my suggestion)
b: run it as root.

The 1024 mark is there ofr a reason: ports below htis are marked ofr use
by daemons and various network services, and should be kept free for such
use: you might bump into somthing else if you use a port that soething
else expects to find anyting at.

Solution: Use a high port number.

Lord Isildur

 
 
 

1. Port < 1024 Binding

Hi,

I've wrote a Java 1.2.2 program that listens to SNMP traps which runs under
solaris 7.
I understood that only user root is able to bind port < 1024, if this is
true then how one would be able to run applications that deal with
SNMP\Telnet\FTP..? Is there a way to work around this?

2. Help with signal trap.

3. Non-root binding to ports < 1024

4. Apache - Bad Header - error

5. how to bind to port < 1024 (OT)

6. ISP connection with ppp

7. Port < 1024 Binding

8. problems with LogFormat

9. how to bind to port < 1024

10. Allow binding to sockets < 1024 -- good idea?