http://man7.org/linux/man-pages/man8/pam_loginuid.8.html suggests that we should use that for all "entry point"s for the user. I guess we can add it. Are you logging in using gdm? We don't refer to pam_loginuid.so anywhere, so it's understandable that /proc/self/loginuid is not set either. Apparently, Ubuntu has the following: /etc/pam.d/common-session-noninteractive: session [default=1] pam_permit.so session requisite pam_deny.so session required pam_permit.so session required pam_unix.so session optional pam_winbind.so session required pam_loginuid.so And then they @include the file above in /etc/pam.d/gdm