Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > wtmp (access) log file

wtmp (access) log file
Thread Tools
Mac Enthusiast
Join Date: Dec 2000
Location: Germany
Status: Offline
Reply With Quote
Jul 15, 2003, 12:26 PM
 
I don't seem to have one! Is that normal, how do I start it going? I'm sure it was there not too long ago, and I need to see who has logged into the machine.
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Jul 16, 2003, 09:23 AM
 
Originally posted by macmad:
I don't seem to have one! Is that normal, how do I start it going? I'm sure it was there not too long ago, and I need to see who has logged into the machine.
Where did you look for wtmp? Mine is in /var/log/. Do:

ls /var/log/wtmp*

What do you get?

What do you get when you type a single w at the command prompt in a terminal? Also try the command 'last' ( without the quote marks).
-DU-...etc...
     
macmad  (op)
Mac Enthusiast
Join Date: Dec 2000
Location: Germany
Status: Offline
Reply With Quote
Jul 16, 2003, 12:27 PM
 
utidjian, thanks, but I've found the problem. When the wtmp file is deleted for some reason, it is not automatically recreated. This is probably common knowledge for smarter men than me, but I was going mad trying to find out what happened!

OK, what to do?? Make a new one! You do that like this:

"sudo touch /var/log/wtmp" then "sudo chmod 644 /var/log/wtmp" so you can read it.

Logging has started again, and I'm happy!
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Jul 16, 2003, 11:56 PM
 
Originally posted by macmad:
utidjian, thanks, but I've found the problem. When the wtmp file is deleted for some reason, it is not automatically recreated. This is probably common knowledge for smarter men than me, but I was going mad trying to find out what happened!

OK, what to do?? Make a new one! You do that like this:

"sudo touch /var/log/wtmp" then "sudo chmod 644 /var/log/wtmp" so you can read it.

Logging has started again, and I'm happy!
Ummm... I would find it VERY suspicious that my wtmp file "is deleted for some reason". There is NO way that that should happen. It is a critical log file for security.
If you look at the /etc/monthly script you will see that /var/log/wtmp is "rotated", compressed and renamed once a month. According to that script, after 5 months or so, you should have (under /var/log/)
wtmp
wtmp.0.gz
wtmp.1.gz
wtmp.2.gz
wtmp.3.gz
and
wtmp.4.gz

Will be perhaps less if you did a clean re-install. It may be that it was never created in the first place in which case it is a problem of the installer. Usually when a log file gets deleted it is something that the root user did inadvertently or a cracker did to cover its tracks. No file on a Unix system just up and dissappears for no reason... especially log files.

If I were you I would keep a close watch on my log files for a while. If it dissappears again you may have a MUCH bigger problem.

BTW /etc/monthly will chmod those files to 0640 automatically NOT 0644. They do not need to be and should not be 0644 in order for you to use "last".
-DU-...etc...
     
macmad  (op)
Mac Enthusiast
Join Date: Dec 2000
Location: Germany
Status: Offline
Reply With Quote
Jul 17, 2003, 12:27 AM
 
I hear you! This was also my concern! However, I have been using LogMaster to read my log files, it has a big trash button to 'clear' the log, and I think this must have deleted /var/log/wtmp . When I tried to subsequently read the access log with LogMaster it always 'unexpectedly quit' - so, a program bug.

I had enabled SSH and so I wanted to check that no one had gotten in - as you say, if they had, they'd have probably deleted /var/log/wtmp too! I will keep an eye on this!
     
   
Thread Tools
Forum Links
Forum 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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:08 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2