Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-22-2006, 09:26 AM   #1
Registered: Nov 2004
Distribution: KDE Neon User edition; Manjaro; OpenSUSE Leap
Posts: 298

Rep: Reputation: 31
How do I get non root access to bind a socket to port 80?

I'm using python's SimpleHTTPServer but I can only bind it to port 80 as root otherwise I get an exception socket.error: (13, 'Permission denied'). How can I give a user permission to port 80?
Old 04-22-2006, 11:19 AM   #2
Registered: Apr 2006
Location: Pittsburgh
Distribution: Debian Sid AMD64
Posts: 296

Rep: Reputation: 30
I don't think you can.

Instead, there are several things you could do to work around it:
  • Run the webserver on some other port. If the number is higher than 1024, any user can bind to it.
  • Start the webserver using sudo.
Old 04-22-2006, 11:30 AM   #3
Registered: Nov 2004
Distribution: KDE Neon User edition; Manjaro; OpenSUSE Leap
Posts: 298

Original Poster
Rep: Reputation: 31
Ok thanks ataraxia, I just found another way around it as well, it involves your first point of running it on a different port and using iptables to route traffic from port 80 to the port the server is on. I was just going to run it on the default 8000 but apparently using :8000 after the rest of the URL doesn't work in IE.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot bind to socket: address already in use exfacior Linux - Wireless Networking 0 09-27-2004 01:34 PM
Linux Socket Bind Program Won't show with netstat rnice Programming 2 09-18-2004 10:59 AM
Help me with this socket address bind program. rnice Linux - Networking 0 09-17-2004 08:33 PM
Why is my socket unable to bind to the port in the C Code. mcp_achindra Programming 10 03-24-2004 09:34 AM
Could not bind listening socket chabotrobert Linux - Networking 1 10-29-2003 01:36 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:27 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration