Networking Forums

Networking Forums > Computer Networking > Linux Networking > can't bind to port: 80 Permission denied

Reply
Thread Tools Display Modes

can't bind to port: 80 Permission denied

 
 
Ciur Eugen
Guest
Posts: n/a

 
      04-01-2009, 03:41 PM
Hi sysadmins!

I try to run a webserver on my machine, but when I start it, it tell
me that it cannot bind to port 80.

> can't bind to port: 80 Permission denied


The problem is that my user probably does not have privileges to use
port 80.
No other application uses that port.
I use debian.

How can a grant user X permissions to bind/use/listen to certain
ports ?

Thanks you !


 
Reply With Quote
 
 
 
 
Robert Harris
Guest
Posts: n/a

 
      04-01-2009, 04:08 PM
Ciur Eugen wrote:
> Hi sysadmins!
>
> I try to run a webserver on my machine, but when I start it, it tell
> me that it cannot bind to port 80.


How do you try to run your webserver? The standard debian way of running
apache is through an init script which allows it to bind to port 80
because it is started by root.

Robert

>
>> can't bind to port: 80 Permission denied

>
> The problem is that my user probably does not have privileges to use
> port 80.
> No other application uses that port.
> I use debian.
>
> How can a grant user X permissions to bind/use/listen to certain
> ports ?
>
> Thanks you !
>
>

 
Reply With Quote
 
Ciur Eugen
Guest
Posts: n/a

 
      04-01-2009, 04:44 PM
I am using lighty (http://www.lighttpd.net/). After compilation to
start it is as simple as:

> lighttpd -f config.conf



On Apr 1, 7:08*pm, Robert Harris <robert.f.har...@blueyonder.co.uk>
wrote:
> Ciur Eugen wrote:
> > Hi sysadmins!

>
> > I try to run a webserver on my machine, but when I start it, it tell
> > me that it cannot bind to port 80.

>
> How do you try to run your webserver? The standard debian way of running
> apache is through an init script which allows it to bind to port 80
> because it is started by root.
>
> Robert
>
>
>
> >> can't bind to port: *80 Permission denied

>
> > The problem is that my user probably does not have privileges to use
> > port 80.
> > No other application uses that port.
> > I use debian.

>
> > How can a grant user X permissions to bind/use/listen to certain
> > ports ?

>
> > Thanks you !


 
Reply With Quote
 
Tauno Voipio
Guest
Posts: n/a

 
      04-01-2009, 07:45 PM
Ciur Eugen wrote:
> I am using lighty (http://www.lighttpd.net/). After compilation to
> start it is as simple as:
>
>> lighttpd -f config.conf

>
>
> On Apr 1, 7:08 pm, Robert Harris <robert.f.har...@blueyonder.co.uk>
> wrote:
>> Ciur Eugen wrote:
>>> Hi sysadmins!
>>> I try to run a webserver on my machine, but when I start it, it tell
>>> me that it cannot bind to port 80.

>> How do you try to run your webserver? The standard debian way of running
>> apache is through an init script which allows it to bind to port 80
>> because it is started by root.
>>
>> Robert
>>
>>
>>
>>>> can't bind to port: 80 Permission denied
>>> The problem is that my user probably does not have privileges to use
>>> port 80.
>>> No other application uses that port.
>>> I use debian.
>>> How can a grant user X permissions to bind/use/listen to certain
>>> ports ?
>>> Thanks you !




For an user-mode server you have to pick
a port above 1024: The ports from 1 to 1023
are privileged ports available to root code
only.

--

Tauno Voipio
tauno voipio (at) iki fi
 
Reply With Quote
 
Bill Marcum
Guest
Posts: n/a

 
      04-01-2009, 08:58 PM
>
> Ciur Eugen wrote:
>> I am using lighty (http://www.lighttpd.net/). After compilation to
>> start it is as simple as:
>>
>>> lighttpd -f config.conf

>>

Have you checked whether there is a Debian package for lighttpd? If you
install that, it should have the proper permission to run.

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      04-02-2009, 03:13 AM
On Apr 1, 8:41*am, Ciur Eugen <ciur.eu...@gmail.com> wrote:

> The problem is that my user probably does not have privileges to use
> port 80.
> No other application uses that port.
> I use debian.
>
> How can a grant user X permissions to bind/use/listen to certain
> ports ?


You probably don't want to do this. But if you insist, here's how you
do it:

1) You run a daemon application, as root, that he connects to.

2) He sends the daemon the port he wants and the IP he wants it bound
to (if any).

3) The root application verifies that his request is allowed,
allocates a socket, and binds it.

4) If there is no error, the root application hands the bound socket
to his application.

Alternatively, it can be done this way:

1) You write a secure daemon application that is setuid-root. He
launches the daemon application.

2) The daemon allocates the port he wants to use.

3) The daemon drops all root privileges and assumes the user's
privileges.

4) The daemon exec's the user's application.

5) The user's application inherits the socket from the daemon.

Again, though, this is not recommend.

DS
 
Reply With Quote
 
Ciur Eugen
Guest
Posts: n/a

 
      04-02-2009, 06:15 AM
For, David Schwartz:

> 1) You run a daemon application, as root, that he connects to.


what application should I run as daemon (as root), that will run
lighty ?


On Apr 2, 6:13*am, David Schwartz <dav...@webmaster.com> wrote:
> On Apr 1, 8:41*am, Ciur Eugen <ciur.eu...@gmail.com> wrote:
>
> > The problem is that my user probably does not have privileges to use
> > port 80.


> > No other application uses that port.
> > I use debian.

>
> > How can a grant user X permissions to bind/use/listen to certain
> > ports ?

>
> You probably don't want to do this. But if you insist, here's how you
> do it:
>
> 1) You run a daemon application, as root, that he connects to.
>
> 2) He sends the daemon the port he wants and the IP he wants it bound
> to (if any).
>
> 3) The root application verifies that his request is allowed,
> allocates a socket, and binds it.
>
> 4) If there is no error, the root application hands the bound socket
> to his application.
>
> Alternatively, it can be done this way:
>
> 1) You write a secure daemon application that is setuid-root. He
> launches the daemon application.
>
> 2) The daemon allocates the port he wants to use.
>
> 3) The daemon drops all root privileges and assumes the user's
> privileges.
>
> 4) The daemon exec's the user's application.
>
> 5) The user's application inherits the socket from the daemon.
>
> Again, though, this is not recommend.
>
> DS


 
Reply With Quote
 
Ciur Eugen
Guest
Posts: n/a

 
      04-02-2009, 08:13 AM
On Apr 2, 9:15*am, Ciur Eugen <ciur.eu...@gmail.com> wrote:
> For, David Schwartz:
>
> > 1) You run a daemon application, as root, that he connects to.

>
> what application should I run as daemon (as root), that will run
> lighty ?
>
> On Apr 2, 6:13*am, David Schwartz <dav...@webmaster.com> wrote:
>
> > On Apr 1, 8:41*am, Ciur Eugen <ciur.eu...@gmail.com> wrote:

>
> > > The problem is that my user probably does not have privileges to use
> > > port 80.
> > > No other application uses that port.
> > > I use debian.

>
> > > How can a grant user X permissions to bind/use/listen to certain
> > > ports ?

>
> > You probably don't want to do this. But if you insist, here's how you
> > do it:

>
> > 1) You run a daemon application, as root, that he connects to.

>
> > 2) He sends the daemon the port he wants and the IP he wants it bound
> > to (if any).

>
> > 3) The root application verifies that his request is allowed,
> > allocates a socket, and binds it.

>
> > 4) If there is no error, the root application hands the bound socket
> > to his application.

>
> > Alternatively, it can be done this way:

>
> > 1) You write a secure daemon application that is setuid-root. He
> > launches the daemon application.

>
> > 2) The daemon allocates the port he wants to use.

>
> > 3) The daemon drops all root privileges and assumes the user's
> > privileges.

>
> > 4) The daemon exec's the user's application.

>
> > 5) The user's application inherits the socket from the daemon.

>
> > Again, though, this is not recommend.

>
> > DS



Oh, I just figured out, i need to use inetd - main network daemon,
that has root access to well known ports. I can configure this daemon
so that it will know applications interested to receive messanges from
port 80 (lighty in my case). Inetd will receive messages as root, and
will "send them" to lighty which will run as another user.

 
Reply With Quote
 
David Schwartz
Guest
Posts: n/a

 
      04-02-2009, 11:17 AM
On Apr 2, 1:13*am, Ciur Eugen <ciur.eu...@gmail.com> wrote:

> Oh, I just figured out, i need to use inetd - main network daemon,
> that has root access to well known ports. I can configure this daemon
> so that it will know applications interested to receive messanges from
> port 80 (lighty in my case). Inetd will receive messages as root, and
> will "send them" to lighty which will run as another user.


That's certainly one way to do it. In your case, that may be the best
way.

DS
 
Reply With Quote
 
Wolfgang Draxinger
Guest
Posts: n/a

 
      04-02-2009, 12:25 PM
Bill Marcum wrote:

> Have you checked whether there is a Debian package for
> lighttpd?


Yes, there is. It's called lighttpd, just installed it yesterday
to implement a local Debian/Ubuntu mirror for my university's
physics faculty network.

Wolfgang

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
user mode permission denied to bind to socket hieswarmcaquest Linux Networking 0 05-03-2011 04:35 PM
nfs gives permission denied pranay.tembhekar@gmail.com Linux Networking 1 05-17-2006 12:25 AM
Workgroup Permission Denied (Usually) Bob Ryan Wireless Networks 1 10-23-2005 10:10 PM
Permission Denied? JBecht Windows Networking 0 10-03-2005 03:25 PM
Network permission is denied? Tim Walsh Windows Networking 1 09-22-2003 02:33 PM



1 2 3 4 5 6 7 8 9 10 11