Page 1 of 1

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

Posted: Thu Apr 23, 2020 5:49 am
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:

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

Posted: Thu Apr 23, 2020 6:11 am
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

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

Posted: Thu Apr 23, 2020 6:54 am
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

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

Posted: Sat Apr 25, 2020 10:06 am
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:

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

Posted: Sat Apr 25, 2020 10:55 am
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