1

On Debian Jessie (latest).

sshd_config is clearly:

PrintMotd no
PrintLastLog yes

But when I login to it from PuTTY, it failed to display the time.

login as: XXXXXXXXXXXXXX
Authenticating with public key "imported-openssh-key"
XXXXXXXX@XXXXXXXXXXXX:~$ _

Any ideas? I'm a IT developer and other servers are working as intended.

  • 2
    Please add mote details, unix version, distro... – Rui F Ribeiro Mar 2 '17 at 10:25
  • what does /var/log/secure show? do you have pam_lastlog configured as well as the SSH having the default PrintLastLog enabled? is the only problem that it won't show the time? in that case it could be something with NTP – Jonroxtech24 Mar 2 '17 at 11:07
2

The lastlog is printed by PAM using pam_lastlog module. If it is not in your PAM stack in /etc/pam.d/sshd (nor in other included files from there), you can add the lines like:

session     [default=1]   pam_lastlog.so nowtmp silent
session     optional      pam_lastlog.so silent noupdate showfailed

(taken from my /etc/pam.d/postlogin on Fedora 25)

0

Make sure you've restarted sshd since adding that line. If it still doesn't work, try commenting out the line and restarting sshd because printing the last login date is default behavior without that line. And just in case, double check to make sure you're editing sshd_config and not ssh_config by accident.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.