LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 08-10-2018, 11:46 AM   #1
p12funk
LQ Newbie
 
Registered: Aug 2018
Distribution: LM 18.1, MX linux
Posts: 13

Rep: Reputation: Disabled
wtmp missing


Hi,

I have run linux mint for many years and recently decided to have a look at mx linux. I installed it a few weeks ago and within the last few days just noticed that I cannot run last or lastb. There is no wtmp or btmp file in /var/log I do not remember if I had ever run last on this os before. I don't know if the file existed and was removed or if it was never there. I have since touched both files and it seems to be logging.

My question is: Are wtmp and btmp installed as part of the mx linux system?

I have done quite a bit of searching and have been unable to find the answer.

Thanks!
 
Old 08-10-2018, 12:50 PM   #2
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,573
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
You can create them yourself as root.
Quote:
Originally Posted by Linux From Scratch
touch /var/log/{btmp,lastlog,faillog,wtmp}
chgrp -v utmp /var/log/lastlog
chmod -v 664 /var/log/lastlog
chmod -v 600 /var/log/btmp
 
1 members found this post helpful.
Old 08-13-2018, 12:25 PM   #3
p12funk
LQ Newbie
 
Registered: Aug 2018
Distribution: LM 18.1, MX linux
Posts: 13

Original Poster
Rep: Reputation: Disabled
wtmp missing

Thanks for the response Hazel! I had already touched the files before posting. Logging now seems to be enabled.

My question though was: Are wtmp and btmp installed as part of the mx linux system?

Not knowing the answer to that, I cannot say if last and lastb were removed from the system or were never there.
 
Old 05-18-2020, 10:04 AM   #4
p12funk
LQ Newbie
 
Registered: Aug 2018
Distribution: LM 18.1, MX linux
Posts: 13

Original Poster
Rep: Reputation: Disabled
lastb

I am still trying to find out if lastb is part of the MX Linux system. I have received info on how to correct it, but that is not my question. Why would lastb be removed from MX Linux? Are wtmp and btmp installed as part of the MX Linux system?
 
Old 05-18-2020, 10:38 AM   #5
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by p12funk View Post
My question is: Are wtmp and btmp installed as part of the mx linux system?
Never ran MX myself, so cannot answer that, but in Slackware "wtmp" and "lastlog" are installed through the standard "etc" package (which doesn't do only etc files:
Quote:
System configuration files. The /etc directory is traditionally the location where configuration files are found.
but btmp is not, you have to create it yourself when you want bad login attempts logged.

PS: faillog, the other log file for failed attempts, is part of the shadow package.
 
Old 05-18-2020, 10:53 AM   #6
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
On Ubuntu 18.04 (I doubt MX Linux is much different in this respect):
Code:
$ grep -A3 /var/log/ /var/lib/dpkg/info/base-files.postinst
  if [ ! -f /var/log/wtmp ]; then
    echo -n>/var/log/wtmp
  fi
  if [ ! -f /var/log/btmp ]; then
    echo -n>/var/log/btmp
  fi
  if [ ! -f /var/log/lastlog ]; then
    echo -n>/var/log/lastlog
  fi
  chown root:utmp /var/log/wtmp /var/log/btmp /var/log/lastlog
  chmod 664 /var/log/wtmp /var/log/lastlog
  chmod 660 /var/log/btmp
  if [ ! -f /var/run/utmp ]; then
    echo -n>/var/run/utmp
  fi
 
Old 05-18-2020, 10:58 AM   #7
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
Quote:
Originally Posted by p12funk View Post
I am still trying to find out if lastb is part of the MX Linux system.
It should be. lastb is part of util-linux.
 
  


Reply



Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
utmp and wtmp missing -32bit current the_penguinator Slackware 2 12-05-2010 03:20 PM
WTMP parsing slerena Linux - General 2 05-15-2008 04:10 AM
WTMP - last command EthanB Linux - Security 1 09-14-2004 09:30 PM
utmp, wtmp Xavius Linux - Newbie 3 04-11-2004 08:29 AM
using wtmp Peter Santiago Linux - General 0 01-07-2002 06:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 08:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration