Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

finding out if anyone has logged on to my account (by su)

Status
Not open for further replies.

mckarl

Programmer
May 5, 1999
147
GB
Hello everyone. Me again :)). <br>
<br>
I'm looking for a solution to find out anyone who is logged on to my account, other than me (diffrent pts/# right??)<br>
<br>
I am looking to place it within a shell script, and if it is possible to see a <b>previouse</b> login to my account (and provide me with the IP address and time) it would be most helpful. - and also who is <b>currently</b> logged into my account. <br>
<br>
(and maybe an activation of a tone, when someone actually <b>logges</b> into my account whilst i am within my own.<br>
<br>
<br>
<br>
-- blimey ... long one! :)<br>
<br>
-karl<br>
<br>
<p> <br><a href=mailto:mc_karl@yahoo.com>mc_karl@yahoo.com</a><br><a href=karls-stuff.co.uk>my stuff :)) WINProducts & stuff</a><br>- Karl<br>
<br>
- <b> the </b> damn good lookin' one ;)
 
look in the syslog - su activity is reported there<br>
<br>
/var/adm/syslog/syslog.log<br>
<br>
-ml<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
thanx Mike, <br>
<br>
only i dont have the correct privaladges. (however you spell it)..<br>
<br>
-karl<br>
<br>
<br>
<br>
<p> <br><a href=mailto:mc_karl@yahoo.com>mc_karl@yahoo.com</a><br><a href=karls-stuff.co.uk>my stuff :)) WINProducts & stuff</a><br>- Karl<br>
<br>
- <b> the </b> damn good lookin' one ;)
 
You can try looking at the file /etc/security/lastlog.<br>
You cannot check your own id because it will be current but if you ask the &quot;root&quot; user he can look for your id and tell when last it logged in successfull and unsuccessfull.<br>
NB: Time is in seconds since 1/1/1970:00:00:00
 
type in #last &lt;username&gt; this will look at the lastlog file
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top