Monday, May 8, 2017

Last login - GUI

Possibly one the first things I've noticed on Solaris 11.3 was the change of login policy last login notification message immediately perceived at the GUI login. Later on an Oracle article talked about it which I considered very useful, Last login tracking in pam_unix_session, and where you can learn more about the change. Under the hood was pam_unix_session(5) a.k.a. pam_unix_session.so.1. By the way, the last logins are registered on the binary file /var/adm/lastlog. To know more about this and other related files you can read login(1) (specially the FILES topic to the end of it) and utmpx(4).

The "new" warning notice is important (even for compliance) as a simple yet crucial security verification: if the system is telling me that my last login was on a date and time I do not recognize, then my account most probably have been compromised! But on some other rather specific scenarios the message can be really annoying. Thus it would be nice to get rid of it:


But how? The aforementioned article tells us how: by tuning the PAM.
I reproduce it here just for added convenience...

Create or update the following file:

$ ll /etc/pam.d/gdm
-rw-r--r--   1 root  sys    52 ... /etc/pam.d/gdm


And add or adjust the following line:

$ grep session /etc/pam.d/gdm
session  required    pam_unix_session.so.1   nowarn

  
Cool!