Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-25-2007, 04:22 AM
|
#1
|
Member
Registered: Oct 2005
Location: Denmark
Distribution: Gentoo & XP pro for gaming
Posts: 152
Rep:
|
"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.
|
|
|
04-25-2007, 05:04 AM
|
#2
|
Member
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940
Rep:
|
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
|
|
|
04-25-2007, 06:27 AM
|
#3
|
Member
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222
Rep:
|
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 06:47 AM.
|
|
|
04-25-2007, 01:30 PM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870
|
you can use strace to see where your particular distro looks...
for example, check last like: 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 01:37 PM.
|
|
|
04-29-2007, 09:13 AM
|
#5
|
Member
Registered: Oct 2005
Location: Denmark
Distribution: Gentoo & XP pro for gaming
Posts: 152
Original Poster
Rep:
|
Quote:
Originally Posted by win32sux
you can use strace to see where your particular distro looks...
for example, check last like: 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!
|
|
|
All times are GMT -5. The time now is 05:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|