Usenet comp.unix.tru64 (2000-2013)
 help / color / mirror / Atom feed
From: Timo Felbinger <Timo.Felbinger@quantum.physik.uni-potsdam.de>
Subject: Re: allow binding privileged port
Date: Thu, 13 Mar 2003 10:23:02 +0100	[thread overview]
Message-ID: <Pine.LNX.4.33.0303131013150.13558-100000@uranos.quantum.physik.uni-potsdam.de> (raw)
In-Reply-To: <39e10c04.0303121904.5960bf62@posting.google.com>


On 12 Mar 2003, ChoongHwan Lee wrote:

> Hello.
>
> I'd like to run my own e-mail server in privileged port 25.
> Though I can get privileged access on my system, I don't want to run
> my program as 'root' account since my program is specified, and it is
> dangerous to do so.
>
> How can I configure to allow non-root user to bind and listen privileged port?
> I've searched documents and articles in Tru64 website and newsgroup,
> but I can't find anything related to this. Is it impossible?
>

Standard method (and portable, too) would be to start the program as
root, bind the port, then use setuid() to drop the root privileges.

Alternatively, you might consider whether you could run your
server via inetd. That might be even simpler, as inetd can do
a lot of work for you: it will bind the port, listen to it, accept
connections, and launch one instance of your program, with a user
id of your choice, for every incoming connection.
(qmail runs in this mode, so you could look into qmail's sources
 for more details).

Cheers,

Timo Felbinger




      reply	other threads:[~2003-03-13  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-13  3:04 allow binding privileged port ChoongHwan Lee
2003-03-13  9:23 ` Timo Felbinger [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox