What is the best way to get another user out of their session on macOS?

In other words:

  • Log in as Bert (who is the administrator)
  • Using quick user switching, log in as Ernie (Bert stays on)
  • Go back to Bert
  • Burt records Ernie off

What is the best way to achieve step 4?

+6
sysadmin macos-sierra macos
source share
2 answers

sudo launchctl bootout user/$(id -u <username>)

Replace <username> target username of the user.

+3
source share

This forum post has a bash script for OSX that should do the trick. It takes the username as an argument and departs from that user.

I have not tried, so your mileage may vary. But it looks like it fits your needs. What exactly are you trying to achieve?

+3
source share

All Articles