Distribute the future // Kelvin Quee

Force logout another user on MacOS

There seems to be no obvious way or easily accessible guide on how to force logout / kick another user on MacOS.

Force quitting / killing loginwindow process seems to leave many processes still running.

The only command that seems to completely kill off all processes owned by the user is:

sudo launchctl bootout user/uid

Do note that the launchctl bootout subservice takes the specifier for the user in the numeric format.

To get the numeric format of a specific user with the username john, use:

$ id -u john
503

As such, to force logout john, you should:

sudo launchctl bootout user/503

Hope this helps! :)

Thoughts? Leave a comment