How to pass successfully login count from pam module.

Asked by Asghar

Hi,

currently i am using Ubuntu 18.04, where i have configured pam to pass the failure login attempts for the user but it does pass success login count from past success login.

cat /etc/pam.d/common-session

session required pam_lastlog.so showfailed

This showfailed was working as expected, i just want the same message type where system should show successfull login attempts from past login,

i am expecting this below type of output from pam, could you please suggest the right config to get the successful login attempts from pam.

I Last success login: Wed Jun 15 11:17:51 UTC 2022 from ::1 on ssh:notty
There were 2 Successful login attempts since the last successful login.
Last login: Wed Jun 15 11:17:55 2022 from ::1

Thanks
Asghar.A

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu pam Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

This does not make any sense.

There cannot be a single successful login attempt since the last successful login, because that would count as successful login and reset the counter!

What do you want to see?

Revision history for this message
Asghar (asgharbasha) said :
#2

i need to know when my user account was logged in and how many times successful attempts happens.

Can you help with this problem?

Provide an answer of your own, or ask Asghar for more information if necessary.

To post a message you must log in.