Mac: Logout a user from the command line
You don’t have to use the macOS UI to logout a user. Instead, in the Terminal use:
sudo launchctl bootout gui/$(id -u <username>)
# or
sudo launchctl bootout user/$(id -u <username>)
Works on macOS 10.11.x or later.
Leave a comment