Solved

Linux: lastb not working after I delete btmp

Posted on 2013-11-18
2
1,032 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 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

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

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…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
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.:

690 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