Use authbind to bind privileged ports on Linux


On Linux system, ports below 1024 are reserved for programs with root privilege. There are several ways to allow regular users to bind these privileged ports without using sudo. For example, using setcap or modifying iptables. Another way is to use authbind software. 

$sudo aptitude install authbind

Create files in /etc/authbind/byport with names of ports your want to bind:

$sudo touch /etc/authbind/byport/80

// or 

$sudo touch /etc/authbind/byport/443

 

Change the permissions of the files:

$sudo chown username:username  /etc/authbind/byport/80

$chmod 750  /etc/authbind/byport/80

Then run authbind with the app: authbind --option app_name, for example:

$authbind --deep app_name

Note: authbind also provide two other ways to bind port: byuid and byaddr.




  


Comments:

Write a comment
Anonymous

Captcha image

Reload

Type the number you see in the image above: