• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ports under 1024

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On my mac, I cannot create a server on any port less than 1024. How do I fix this? Id like to not have to use port forwarding, but if that is necessary, could somebody please explain how? Thank you!!!
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Len Padson wrote:On my mac, I cannot create a server on any port less than 1024. How do I fix this? Id like to not have to use port forwarding, but if that is necessary, could somebody please explain how? Thank you!!!



I believe that only the root user can use ports less than 1024 -- and it is likely for a security reason. So, your only option is to run your program as the root user.

Henry
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Henry Wong wrote:

Len Padson wrote:On my mac, I cannot create a server on any port less than 1024. How do I fix this? Id like to not have to use port forwarding, but if that is necessary, could somebody please explain how? Thank you!!!



I believe that only the root user can use ports less than 1024 -- and it is likely for a security reason. So, your only option is to run your program as the root user.

Henry



Yes, that is correct. I know that certain Linux flavors support administrative options that let non-root users open ports < 1024, but I don't know if Mac has something similar. I'd avoid those ports if possible, and if not possible, you'll have to do it as root. Turning on the setuid bit on your java executable may also work, but that's pretty risky in itself.

reply
    Bookmark Topic Watch Topic
  • New Topic