Subject: does wu-ftpd *have* to run as root?

From: Timothy J Luoma <luomat+Lists/[email-masked]>
Date: Thu, 12 Feb 98 19:31:51 -0500

By default 'ftpd' runs out of inetd.conf as root,

	ftp    stream  tcp     nowait  root    /usr/etc/ftpd   ftpd

I am wondering if this is necessary.  Could I make a different UID and run  
processes as that user? (ie 'notroot')

	ftp    stream  tcp     nowait  notroot    /usr/etc/ftpd   ftpd

I realize that 'notroot' would have to be able to read/write to the  
appropriate ftp files...

Just wondering why it starts as root... does it need to?

I didn't see this in the docs... if I should have please point out where.

Thanks!
TjL

-- 
"It takes real courage to be a Macintosh user; it takes real
conviction; not unlike being a Christian in the days of the Romans." 
 - Guy Kawasaki, Chief Evangelist for Apple Computer - from "Hotseat"
   interview with John McChesney (3/28/97) [ my birthday! ]

---

From: "Gregory A. McLean" <[email-masked]>
Date: Thu, 12 Feb 1998 19:43:21 -0500

> I didn't see this in the docs... if I should have please point out where.

I believe because the ports for ftp are < 1024 it needs to run as root to
open them.

---

From: Dave Wreski <[email-masked]>
Date: Thu, 12 Feb 1998 19:48:24 -0500 (EST)

> Just wondering why it starts as root... does it need to?

Yes, it needs to be started by root.  Services below 1024 require root
permission to bind to them.

You'll notice that it spawns a copy of itself to actually handle the user
connection once the remote user logs in.  It then runs as that user, and
not root.

Dave

---

From: Michael Salmon <[email-masked]>
Date: Wed, 18 Feb 1998 09:03:37 +0100

+----- On Thu, 12 Feb 1998 19:31:51 EST, Timothy J Luoma writes:
| 
| 
| By default 'ftpd' runs out of inetd.conf as root,
| 
| ftp    stream  tcp     nowait  root    /usr/etc/ftpd   ftpd
| 
| I am wondering if this is necessary.  Could I make a different UID and run  
| processes as that user? (ie 'notroot')
| 
| ftp    stream  tcp     nowait  notroot    /usr/etc/ftpd   ftpd
| 
| I realize that 'notroot' would have to be able to read/write to the  
| appropriate ftp files...
| 
| Just wondering why it starts as root... does it need to?
| 
| I didn't see this in the docs... if I should have please point out where.

A number of people have explained that this is required because the ftp 
port is less than 1024. This is partially true though ftpd only opens 
the data port and this doesn't have to be less than 1024. You need to 
run as root so that you can become another user and, in the case of 
anonymous ftp, so that you can chroot.

/Michael