From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,a711d30502b49337 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2003-03-13 01:30:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.stueberl.de!fu-berlin.de!news.uni-potsdam.de!uranos.quantum.physik.uni-potsdam.de!timof From: Timo Felbinger Newsgroups: comp.unix.tru64 Subject: Re: allow binding privileged port Date: Thu, 13 Mar 2003 10:23:02 +0100 Organization: University of Potsdam Message-ID: References: <39e10c04.0303121904.5960bf62@posting.google.com> Reply-To: NNTP-Posting-Host: uranos.quantum.physik.uni-potsdam.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: zeppelin.rz.uni-potsdam.de 1047547398 13509 141.89.72.92 (13 Mar 2003 09:23:18 GMT) X-Complaints-To: usenet@zeppelin.rz.uni-potsdam.de NNTP-Posting-Date: 13 Mar 2003 09:23:18 GMT X-X-Sender: In-Reply-To: <39e10c04.0303121904.5960bf62@posting.google.com> Xref: archiver1.google.com comp.unix.tru64:9710 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