Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linux: lastb not working after I delete btmp

Posted on 2013-11-18
2
Medium Priority
?
1,088 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
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 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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

604 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