When I use ssh to log in to the root user on my server, an entry 0
is created in /var/run/user
because pam_systemd
tells systemd-logind
to do this. This is an indicator that a user session has been started for uid 0.
Then, when I run su jack
, I still only see the 0
entry in /var/run/user
; no entry has been made for this session.
However, journalctl
shows that a pam session was opened, and /etc/pam.d/su
includes common-session
, which adds session optional pam_systemd.so
. So I think that a user session should have been created.
How can I make su
create a user session?
If it's relevant, I'm on Debian 11.
su - jack
? – user10489 May 21 '22 at 20:00systemctl --user
works.su - jack
didn't work either :( – jrpear May 21 '22 at 20:25loginctl enable-linger
to make the user manager of a user start regardless of whether it has a session. When I also have some user service that starts e.g. tmux. Then I'll be able tosystemctl --user
if I attach to the same tmux server (by settingTMUX_TMPDIR
) aftersu -
. – Tom Yan May 22 '22 at 10:28