From owner-freebsd-questions Wed Aug 8 21:36: 8 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mail8.nc.rr.com (fe8.southeast.rr.com [24.93.67.55]) by hub.freebsd.org (Postfix) with ESMTP id 111BC37B401 for ; Wed, 8 Aug 2001 21:36:06 -0700 (PDT) (envelope-from bts@babbleon.org) Received: from i8k.babbleon.org ([66.26.250.89]) by mail8.nc.rr.com with Microsoft SMTPSVC(5.5.1877.687.68); Thu, 9 Aug 2001 00:35:48 -0400 Content-Type: text/plain; charset="iso-8859-1" From: Brian T.Schellenberger To: Mike Meyer , Eric Anderson Subject: Re: finding user of su Date: Wed, 8 Aug 2001 20:59:00 -0400 X-Mailer: KMail [version 1.2] Cc: questions@FreeBSD.ORG References: <15217.48743.5521.681759@guru.mired.org> In-Reply-To: <15217.48743.5521.681759@guru.mired.org> MIME-Version: 1.0 Message-Id: <01080820590001.19642@i8k.babbleon.org> Content-Transfer-Encoding: 8bit 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 Wednesday 08 August 2001 18:34, Mike Meyer wrote: > Eric Anderson types: > > Is there a tool (or how would I write one) that can tell me the original > > user after an su? Basically, if I su to root, how can I tell who I su'd > > from? > > There are a number of ways, but none are 100% reliable. You can check > the USER environment variable, which the su command normaly doesn't > change. You can suspend or exit the shell, and see what user you wind > up as. There are probably other ways as well. Indeed, the whole purpose of su is to make it impossible to tell. Everybody ultimately descends from process 0, but it has to be possible to "start afresh" and that's what su does. When you su you really become root (or whoever) . . . and if you "su -" then even the environment is reset. You really shouldn't need to know . . . if people are su'ing so much that it's a problem, they are su'ing too much, and you should look into "sudo" or (my personal preference) "op" in order to avoid having to "su" all the time. -- Brian T. Schellenberger . . . . . . . bts@wnt.sas.com (work) Brian, the man from Babble-On . . . . bts@babbleon.org (personal) --------------------> Free Dmitry Sklyarov! <------------------------- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message