LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices



Reply
 
Search this Thread
Old 06-15-2004, 10:54 AM   #1
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Rep: Reputation: 30
Logging user in & out


Does anyone know a script that will monitor user login, and logout?
I've seen this before, and I've used it before... I just cannot remember what it was.

I'll go into a little detail here...

After a user logs in, it will print (via stdout) and show, while logging inside of a file (tail -f filename?). I'm assuming it'd be watching /dev/tty (correct?). If this doesn't make sense, just tell me.
 
Old 06-15-2004, 12:29 PM   #2
iainr
Member
 
Registered: Nov 2002
Location: England
Distribution: Ubuntu 9.04
Posts: 631

Rep: Reputation: 30
How about the last command
Code:
last
Quote:
Last searches back through the file /var/log/wtmp (or the file desig-
nated by the -f flag) and displays a list of all users logged in (and
out) since that file was created. Names of users and tty's can be
given, in which case last will show only those entries matching the
arguments. Names of ttys can be abbreviated, thus last 0 is the same
as last tty0.
 
Old 06-15-2004, 12:55 PM   #3
Crunch
Member
 
Registered: Feb 2003
Location: York, PA
Distribution: Slackware, FreeBSD, OpenBSD
Posts: 162

Original Poster
Rep: Reputation: 30
Ah, thank you.... I guess I could use this. Say, you think I could get this to print to stdout whenever a user logs in? Such as when they login, on my terminal window it shall show something such as:

Code:
$

$date $time       $user     has logged in

$
 
Old 06-20-2004, 06:48 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,818
Blog Entries: 54

Rep: Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991Reputation: 2991
There's a PAM module that can log logins/outs. Can't remember what it's called tho. Getting that info to you screen is just tailing the logfile.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Logging in as non-privileged user TastyWheat Linux - Security 2 09-27-2004 02:58 AM
Is there a way to change user without logging out? Hevonen Linux - Newbie 7 03-11-2004 06:12 PM
KDesktop & Konqueror - Error when logging in as normal user Boby Linux - Newbie 2 02-23-2004 07:23 AM
Logging On As Root User BACTRATE Mandriva 6 02-16-2004 11:48 AM
User news logging in? Mike_the_Man Linux - General 0 07-01-2002 08:56 AM


All times are GMT -5. The time now is 05:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration