This question already has an answer here:

Related to Why my linux doesn't display last login date?

There's no "pam_lastlog" lines on BOTH servers' /etc/pam.d/sshd file. But "Machine 2" output the time. (and Machine 1 don't). The only differences are(sshd_config):

(1) LOGIN BY PUBKEY PubkeyAuthentication yes AuthorizeKeysFile /xxxx PasswordAuthentication No

(2) LOGIN BY USER+PASS ('PasswordAuthentication Yes' is not exist) PubkeyAuthentication No

Of course, I always update them using apt-get. Why this is different?

(1) :~$ lastlog /var/log/lastlog: No such file or directory :~$ sudo su :~# lastlog /var/log/lastlog: No such file or directory uname -a Linux X 3.16.0-4-686-pae #1 SMP Debian 3.16.39-1+deb8u1 (2017-02-22) i686 GNU/Linux

(2) :~# lastlog Username Port From Latest...... uname -a Linux X 3.16.0-4-686-pae #1 SMP Debian 3.16.39-1 (2016-12-30) i686 GNU/Linux apt-get dist-upgrade 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

marked as duplicate by Jakuje, countermode, GAD3R, Archemar, Jeff Schaller Mar 3 '17 at 11:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • "If it is not in your PAM stack in /etc/pam.d/sshd (nor in other included files from there)". Did you try to add that in your /etc/pam.d/sshd? – Jakuje Mar 3 '17 at 8:26

Browse other questions tagged or ask your own question.