Why "last" command can't open the /var/log/wtmp file?

Message
Author
bluedigit
Posts: 26
Joined: Tue May 09, 2017 6:05 am

Why "last" command can't open the /var/log/wtmp file?

#1 Post by bluedigit »

I am trying to check who is logged in my lap, so I've run <w> command to get who is logged in and, cause I was the only shown, I tried to run <last> to get older accesses... thought MX might have a different way coming from AntiX, so how can I access the older logins logs?!? Help! :bawling:

bluedigit
Posts: 26
Joined: Tue May 09, 2017 6:05 am

Re: Why "last" command can't open the /var/log/wtmp file?

#2 Post by bluedigit »

Basically I simply need to view the login logs, I know the wtmp file can't be open if doesn't exist... :p

User avatar
gosia
Posts: 1140
Joined: Sun Apr 28, 2019 3:43 pm

Re: Why "last" command can't open the /var/log/wtmp file?

#3 Post by gosia »

For me last works without problems. And /var/log/wtmp exists.

Code: Select all

gosia    tty2                          Fri Apr  3 14:46 - 14:55  (00:08)
kb       tty7         :0               Fri Apr  3 11:00 - 14:46  (03:45)
reboot   system boot  4.19.0-1-amd64   Fri Apr  3 10:57 - 14:55  (03:58)
kb       tty7         :0               Thu Apr  2 21:10 - down   (02:57)
gosia    tty7         :0               Thu Apr  2 16:53 - 21:10  (04:17)
kb       tty7         :0               Thu Apr  2 16:48 - 16:52  (00:03)
reboot   system boot  4.19.0-1-amd64   Thu Apr  2 16:47 - 00:07  (07:20)
kb       tty7         :0               Thu Apr  2 16:36 - down   (00:09)
gosia    tty7         :0               Thu Apr  2 16:29 - 16:36  (00:06)

wtmp begins Thu Apr  2 16:29:13 2020

Code: Select all

$ inxi -S
System:    Host: mexiko.fritz.lokal Kernel: 4.19.0-1-amd64 x86_64 (64 bit) Desktop: Openbox 3.6.1
           Distro: MX-18.3_x64 Continuum March 14, 2018

bluedigit
Posts: 26
Joined: Tue May 09, 2017 6:05 am

Re: Why "last" command can't open the /var/log/wtmp file?

#4 Post by bluedigit »

Code: Select all

$ inxi -S
System:    Host: mx Kernel: 5.4.7-antix.1-amd64-smp x86_64 bits: 64 Desktop: Xfce 4.14.2 
           Distro: MX-19.1_ahs_x64 patito feo February 15  2019 

Code: Select all

$ last
last: cannot open /var/log/wtmp: File o directory non esistente
What should I do so...?
:confused:

User avatar
fehlix
Developer
Posts: 12704
Joined: Wed Apr 11, 2018 5:09 pm

Re: Why "last" command can't open the /var/log/wtmp file?

#5 Post by fehlix »

bluedigit wrote: Sat Apr 25, 2020 10:06 am What should I do so...?
This:

Code: Select all

sudo touch /var/log/wtmp

Code: Select all

sudo touch /var/log/btmp
see:
viewtopic.php?p=496200#p496200
or

Code: Select all

man last

Post Reply

Return to “Software / Configuration”