From owner-freebsd-questions Mon Aug 19 7:36:51 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1EC2E37B400 for ; Mon, 19 Aug 2002 07:36:48 -0700 (PDT) Received: from slate.dublin.wbtsystems.com (slate.dublin.wbtsystems.com [193.120.231.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DCDE43E6A for ; Mon, 19 Aug 2002 07:36:47 -0700 (PDT) (envelope-from barry.byrne@wbtsystems.com) Received: from spiral (spiral.dublin.wbtsystems.com [193.120.231.190]) (authenticated bits=0) by slate.dublin.wbtsystems.com (8.12.5/8.12.5) with ESMTP id g7JEahHI027878; Mon, 19 Aug 2002 15:36:43 +0100 (IST) From: "Barry Byrne" To: "Rob Ellis" , Subject: RE: Run a command as another user Date: Mon, 19 Aug 2002 15:36:42 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <20020819141452.GB30342@web.ca> X-Scanned-By: slate/MIMEDefang 2.17 (www . roaringpenguin . com / mimedefang) 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 The su man page is a bit confusing. Actually, the -c option has two uses. If the -c appears after a specified login user, it means 'run command': e.g. su barney -c 'touch /tmp/test1" means run 'touch /tmp/test1' as user 'barney' If the -c option appears prior to a specified login user, it means run under resource restrictions of specifed class: e.g. su -c staff barney -c '/usr/local/bin/touchjob arg1' means run '/usr/local/bin/touchjob arg1' as user barney, with resources of login class 'staff'. Cheers, Barry -- Barry Byrne, IT Manager, WBT Systems, Block 2, Harcourt Centre Harcourt Street, Dublin 2, Ireland > -----Original Message----- > From: owner-freebsd-questions@FreeBSD.ORG > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Rob Ellis > Sent: 19 August 2002 15:15 > To: freebsd-questions@FreeBSD.ORG > Subject: Re: Run a command as another user > > > > # su anotheruser -c program > > > > btw, the man page (at least on two of my STABLE systems) lies: > > the -c switch allows one to specify a command, not login class > > the -c in 'su username -c command' is an option passed to sh... > > su [-Kflm] [-c class] [login [args]] > > it's one of the 'args', a different -c. > > - rob > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message