From owner-freebsd-questions Wed Aug 8 15:34:38 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 AB6FF37B4EC for ; Wed, 8 Aug 2001 15:34:15 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 34794 invoked by uid 100); 8 Aug 2001 22:34:15 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15217.48743.5521.681759@guru.mired.org> Date: Wed, 8 Aug 2001 17:34:15 -0500 To: Eric Anderson Cc: questions@freebsd.org Subject: Re: finding user of su In-Reply-To: <66038193@toto.iv> 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 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. 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