LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 04-25-2007, 03:22 AM   #1
phsythax
Member
 
Registered: Oct 2005
Location: Denmark
Distribution: Gentoo & XP pro for gaming
Posts: 152

Rep: Reputation: 30
"Last login: " Where is it stored?


Where is the "last login" variable stored? it appears when logging in on a local terminal or threw ssh remotely.
 
Old 04-25-2007, 04:04 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
on my debian system the command /urs/bin/lastlog does the trick for me, though it does not tell me where it is stored, only shows the details for each user
 
Old 04-25-2007, 05:27 AM   #3
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
These are usually logged in:

/var/log/wtmp
/var/log/utmp
/var/log/lastlog

The location could be different depending on the distro. These are data files so you can only view the results with the last and
lastlog commands

edit: these files are also used by the w and who commands

Last edited by SlackDaemon; 04-25-2007 at 05:47 AM.
 
Old 04-25-2007, 12:30 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
you can use strace to see where your particular distro looks...

for example, check last like:
Code:
strace last
you should see lines like this within the output:
Code:
open("/var/log/wtmp", O_RDONLY)         = 3
open("/etc/localtime", O_RDONLY)        = 4

Last edited by win32sux; 04-25-2007 at 12:37 PM.
 
Old 04-29-2007, 08:13 AM   #5
phsythax
Member
 
Registered: Oct 2005
Location: Denmark
Distribution: Gentoo & XP pro for gaming
Posts: 152

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by win32sux
you can use strace to see where your particular distro looks...

for example, check last like:
Code:
strace last
you should see lines like this within the output:
Code:
open("/var/log/wtmp", O_RDONLY)         = 3
open("/etc/localtime", O_RDONLY)        = 4
Okey, Thanks everyone!
 
  


Reply



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
squirrelmail "error in login page"" when content advisor is enabled simi_virgo Linux - Networking 4 08-21-2008 01:25 PM
No UTMPX entry, You must EXEC "login" for the lowest "shell" ooihc Solaris / OpenSolaris 7 03-12-2007 02:09 PM
"Input signal out of range" where are the KDE settings stored? whoisdon Linux - Software 1 10-18-2006 12:44 AM
Files stored on "A" disks from Linux won't show up as existing on Win. File Manager jenifer_e_church Linux - Software 4 03-21-2006 05:26 PM
Howto disable "Graphical Login" or "Standard Login?" the_gripmaster Red Hat 1 07-08-2004 02:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:59 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
Open Source Consulting | Domain Registration