From owner-freebsd-questions Wed Aug 8 18:31:16 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-27-141-144.mmcable.com [24.27.141.144]) by hub.freebsd.org (Postfix) with SMTP id 3EE3337B403 for ; Wed, 8 Aug 2001 18:31:04 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 39558 invoked by uid 100); 9 Aug 2001 01:30:55 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15217.59343.135209.179513@guru.mired.org> Date: Wed, 8 Aug 2001 20:30:55 -0500 To: David Scheidt Cc: Eric Anderson , Subject: Re: finding user of su In-Reply-To: References: <15217.48743.5521.681759@guru.mired.org> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ 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 David Scheidt types: > On Wed, 8 Aug 2001, 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. > : > > su-2.03# whoami > root > su-2.03# who am i > david ttyp4 Aug 2 19:24 (:0.0) I get different results: guru# whoami root guru# who am i root ttyp0 Aug 8 20:28 guru# http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message