From owner-freebsd-questions Fri Oct 26 14: 1:57 2001 Delivered-To: freebsd-questions@freebsd.org Received: from webs1.accretive-networks.net (webs1.accretive-networks.net [207.246.154.13]) by hub.freebsd.org (Postfix) with ESMTP id 9409B37B408 for ; Fri, 26 Oct 2001 14:01:41 -0700 (PDT) Received: from localhost (davidk@localhost) by webs1.accretive-networks.net (8.11.1/8.11.3) with ESMTP id f9QL1dG28179; Fri, 26 Oct 2001 14:01:39 -0700 (PDT) Date: Fri, 26 Oct 2001 14:01:39 -0700 (PDT) From: David Kirchner X-X-Sender: To: Michael Grant Cc: Subject: Re: running a program as nobody In-Reply-To: <200110262059.VAA21039@splat.grant.org> Message-ID: <20011026140025.U25870-100000@localhost> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 26 Oct 2001, Michael Grant wrote: > I want to run a particular daemon as userid nobody. I tried the > obvious thing of using su like this: > > su -c nobody nobody /usr/local/bin/food > > but no matter what I try, I cannot get something like this to work. > > Is there some standard way to do this other than writing a C program > wrapper myself? I see something called "jail" but that seems a bit > heafty, it looks like I would have to install a complete version of > freebsd in some directory practically creating a virtual machine. > > Surely there must be some simple way to do run a program as nobody, > maybe chrooted as well? The format would be: su nobody -c /path/to/command If you want it chroot'd I think you're safe doing: chroot /new/root su nobody -c /path/to/command/relative/to/new/root I believe you'd need "su" in your /new/root, too. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message