Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using CentOS 6. How can I configure it so the system notifies the user, upon successful login, of the date and time of the last login? Is that possible?

share|improve this question
Doesn't ssh do that by default? – jordanm Jan 10 '13 at 17:49

You can the pam_lastlog module to display the date of last login upon successful logon.

You can refer to the pam_lastlog man page for more options, but to accomplish what you want just add the following to the /etc/pam.d/login file

session required pam_lastlog.so nowtmp
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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