LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 04-22-2006, 08:26 AM   #1
APB_4
Member
 
Registered: Nov 2004
Location: England
Distribution: Ubuntu 9.04; Crunchee; EEE Xandros
Posts: 289

Rep: Reputation: 30
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, 10:19 AM   #2
ataraxia
Member
 
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, 10:30 AM   #3
APB_4
Member
 
Registered: Nov 2004
Location: England
Distribution: Ubuntu 9.04; Crunchee; EEE Xandros
Posts: 289

Original Poster
Rep: Reputation: 30
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.
 
  


Reply


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 12:34 PM
Linux Socket Bind Program Won't show with netstat rnice Programming 2 09-18-2004 09:59 AM
Help me with this socket address bind program. rnice Linux - Networking 0 09-17-2004 07:33 PM
Why is my socket unable to bind to the port in the C Code. mcp_achindra Programming 10 03-24-2004 08:34 AM
Could not bind listening socket chabotrobert Linux - Networking 1 10-29-2003 12:36 PM


All times are GMT -5. The time now is 08:33 PM.

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