How to bind a privileged port without privileges?

1.1k Views Asked by At

I have a piece of daemon code that is supposed to be invoked by jsvc. The code needs to bind to a privileged port below 1024. I do not have root access so I am thinking of authbind. I tried:

authbind --deep jsvc ...

but in jsvc.err, it still says:

java.net.SocketException: Permission denied

Am I doing anything wrong?

1

There are 1 best solutions below

0
Ortomala Lokni On

Yes, you probably forgot to configure authbind.

If you want to allow user jo to bind port 80 you have to run the following commands as root.

root@lappy:~# touch /etc/authbind/byport/80
root@lappy:~# chown jo:jo /etc/authbind/byport/80
root@lappy:~# chmod 755 /etc/authbind/byport/80

Read the Running network services as a non-root user from the Debian Administration Guide for more information.