Each time you log in in as a user, you get a new PAM session. E.g. I believe people have used pam_group
to add your session's processes to groups for access to certain devices, if you log on to a local terminal.
pam_systemd
starts one systemd --user
instance, which is shared between all the user's login sessions. Nowadays, e.g. in Fedora 26, you will see all gnome-terminal processes are actually started by systemd --user
. So that's where your terminal commands run. They do not run in the systemd session scopes that are created for each individual login...
How is the single systemd --user
instance, and the processes it creates, affected by the PAM sessions?