Created
February 13, 2020 07:59
-
-
Save jvahldick/f8cfb176d0de4883a41a9dc1358ba1dc to your computer and use it in GitHub Desktop.
OSX Remove the session from the logged the user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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