Skip to content

Instantly share code, notes, and snippets.

@jvahldick
Created February 13, 2020 07:59
Show Gist options
  • Save jvahldick/f8cfb176d0de4883a41a9dc1358ba1dc to your computer and use it in GitHub Desktop.
Save jvahldick/f8cfb176d0de4883a41a9dc1358ba1dc to your computer and use it in GitHub Desktop.
OSX Remove the session from the logged the user
# List users that are already logged in
ps aux | grep loginwindow | grep -v grep | awk {'print $1'}
# Remove the session from the logged the user
# Be aware that the user might lose everything unsaved from their session
sudo kill -9 $(ps aux | grep the-chosen-user | grep loginwindow | grep -v grep | awk {'print $2'})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment