Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Oct 2001 14:15:57 -0700 (PDT)
From:      David Kirchner <davidk@accretivetg.com>
To:        Michael Grant <mg-fbsd2@grant.org>
Cc:        <freebsd-questions@FreeBSD.ORG>
Subject:   Re: running a program as nobody
Message-ID:  <20011026141508.M25870-100000@localhost>
In-Reply-To: <200110262113.WAA21068@splat.grant.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 26 Oct 2001, Michael Grant wrote:

> > 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.
>
> Thanks, that appears to work, so the man page for su appears to be
> wrong:
>
>   su [-] [-Kflm] [-c class] [login [args]]

Actually it's correct - it's a bit confusing about it though, I'll agree.
:-)

The -c you're passing after the login (nobody) is actually being sent to
/bin/sh, which tells /bin/sh to process it as if it were something typed
in to sh, rather than as if it were a shell script.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011026141508.M25870-100000>