I recently discovered the need to elevate the application to a higher privilege level so that bind() to port <1024.
I ran it with sudo , which is great for internal testing, but deploying it with root privileges is usually a very bad idea.
I heard about the root of setuid server, but when I looked at the source code for lighthttpd , for example, it shows:
#ifdef HAVE_GETUID if (!i_am_root && issetugid()) { /* we are setuid-root */ log_error_write(srv, __FILE__, __LINE__, "s", "Are you nuts ? Don't apply a SUID bit to this binary"); server_free(srv); return -1; } #endif
What is the common way to allow privileged port binding? I only need a higher privilege for bind. After that, he can work as a regular user.
These are the ones Iβve heard of, but itβs not what is used by most software, so I ask this question.
source share