Solved

Linux: lastb not working after I delete btmp

Posted on 2013-11-18
2
954 Views
Last Modified: 2013-11-18
My /var/log/btmp file was too large so I deleted it.  I then created a new file with the same name and permissions:
touch /var/log/btmp
chown root:utmp /var/log/btmp
chmod 600 /var/log/btmp

Open in new window

The problem is that now new items are NOT logged.

$ lastb
btmp begins Mon Nov 18 06:38:03 2013

I use CentOS.

I found this link, demonstrating that I am not the only one to experiance this problem:
http://www.linuxforums.org/forum/red-hat-fedora-linux/35328-lastb-command-not-working.html
0
Comment
Question by:hankknight
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
Luxana earned 500 total points
ID: 39657074
try change permissions. They should be:

-rw-rw---- 1 root utmp

do:

chmod 660 /var/log/btmp

at the moment only root has wr permissions to this file..
0
 
LVL 10

Expert Comment

by:Luxana
ID: 39657108
BTW: never delete your log files unless you have to. Best way to clean your log files is  simply to remove the content with:

# > /var/log/btmp

the above will simply remove content of the file while keeping file permissions intact.

cheers...
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now