How do I kill a session using loginctl on redhat?
blackrhino last edited by
This kills all processes for a user session.
First list the sessions and obtain the session ID.
$ loginctl list-sessions SESSION UID USER SEAT TTY 2 1000 training seat0 tty2 5 1000 training c1 42 gdm seat0 tty1 3 sessions listed.
kill-session ID... Send a signal to one or more processes of the session. Use --kill-who= to select which process to kill. Use --signal= to select the signal to send.
Kill the session 5 for user training.
$ loginctl kill-session 5
© Lightnetics 2022