You are not logged in.

#1 2023-11-29 17:40:55

m3nhir
Member
From: Torino - Italy
Registered: 2020-04-03
Posts: 33

[solved] "last" command does not update

Running the "last" command from shell this does not return me the user logins updated, but only some time ago, almost a month old. What do I need to do to update that report? or is there an alternative command to find out which users are last logged in.
Thanks

Last edited by m3nhir (2023-11-29 21:52:46)


Intelligence is not making mistakes, but find out how to profit immediately.

Offline

#2 2023-11-29 18:25:04

dogknowsnx
Member
Registered: 2021-04-12
Posts: 648

Re: [solved] "last" command does not update

Check whether it's only truncated due to your terminal's scrollback limit:

last | head -n 10

EDIT:
or

last | less

for that matter...

Last edited by dogknowsnx (2023-11-29 18:38:55)


RI - Rest your Eyes and Self

"We are eternal, all this pain is an illusion" - Maynard James Keenan

Offline

#3 2023-11-29 19:37:03

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [solved] "last" command does not update

Can we see

stat /var/log/wtmp

As for alternatives, see this horribly hacky script example: https://forum.openwrt.org/t/last-comman … ve/98548/4

Don't know of any other equivalent commands though.

Offline

#4 2023-11-29 21:52:01

m3nhir
Member
From: Torino - Italy
Registered: 2020-04-03
Posts: 33

Re: [solved] "last" command does not update

Thanks for your help, to check the latest accesses I used:

 last -F -n 10

I tried running it as root, indicating the user and it worked fine.
After I ran it as a normal user it gave me the correct data. I didn't understand the anomaly at first but I solved it.


Intelligence is not making mistakes, but find out how to profit immediately.

Offline

Board footer

Powered by FluxBB