Le 25/11/2013 22:59, Josep L. Guallar-Esteve a �crit :
> Not really.
>
> Ports 0-1024 are "protected" for "known" services. Check the
> /etc/services file on any Unix system (not sure if it's there on a RPi
> Linux distro).
>
> By "protected", they must be used by system daemons. Thus, a regular
> user cannot (should not be able to ) start them.
>
There are two ways for a � user � process to open ports less than 1024 :
- either you use setcap to give this specific program explicit
permission to open ports less than 1024
- either you launch the program as root, create the server socket as
root, and then the program impersonate itself using a setuid call
(usually, impersonification to a special user created for running the
service, in old times most services used nobody).
AFAIK, nearly all services uses the second way (since init scripts are
run by root, impersonification is needed anyway).
There�s also a third way of doing things : creating a local port
forwarding rule forwarding port 502 to port 1502.
Regards,
Julien