0

I use lastlog to check latest login datetime. Here are steps I use to update my latest login datetime.

1) Try to Login to that user

sudo su userA

2) Exit that user and login to root then check latest login datetime

lastlog -u userA

3) But the result is not updated and will be

"Never logged in"

Can I know the root cause here or the solution how to update it? I usually try this way and can update other users.

Binh Nguyen
  • 101
  • 2
  • Root "becoming" userA does not mean userA logged in. The login process wasn't involved. You could try "su - userA" but I'm not sure. – Gerard H. Pille Jan 28 '19 at 04:51
  • It might be because you're using 'su' (without the hyphen). This claims that 'su -' creates a login shell whereas the other does not. – Tran Triet Feb 02 '19 at 14:15

0 Answers0