?
Solved

Linux: lastb not working after I delete btmp

Posted on 2013-11-18
2
Medium Priority
?
1,058 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
Luxana earned 2000 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

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 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