<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I think the users command always prints
the original user. I logged on as some user, did a sudo -i, called
users again and it gave me my original user name. also works with
sudo su -<br>
<br>
<br>
<div class="moz-signature"><b>Lutz Andersohn</b><br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:lutz.andersohn@gmail.com">lutz.andersohn@gmail.com</a><br>
(925) 784 1565<br>
D-19318, AFF-I<br>
<br>
<a class="moz-txt-link-freetext" href="http://www.linkedin.com/pub/1/b65/2b6">http://www.linkedin.com/pub/1/b65/2b6</a>
Public key ID: 0x9620D1A6</div>
On 10/03/2013 02:14 PM, Peter Flynn wrote:<br>
</div>
<blockquote cite="mid:524DC229.7080604@silmaril.ie" type="cite">
<pre wrap="">Does anyone know how a bash script can detect what username you
originally logged in with after you have become root?
That is, if I ssh into a machine, and sudo su -, I want a script to be
able to find out who I was before I became root.
///Peter
</pre>
</blockquote>
<br>
</body>
</html>