UID then rm /tmp/backgroundUserLogout.
You can find more shortcuts here.
Now a simple mod to the sudoers file using visudo and you're good.
You can reach Alan Henry, the author of this post, at, or better yet, follow him.First, create a shell script /bin/usertimeout owned by root, chmod it to 755, and paste the following content into dz arion key editor the file #!/bin/bash # Timeout is the number of seconds a login session can be idle before it is # automatically logged out.Note that the example above runs every minute, depending on the idle time you allow, you might want to increase this to a more suitable frequency (e.g.UID else if ( date s - stat -f m /tmp/backgroundUserLogout.Replace username with the target user's user name or replace the whole subshell with the user's uid.Join us in person, in October, for the annual Jamf Nation User Conference (jnuc) to discover new and better ways to manage Apple devices.Users ALL(ALL) nopasswd: /sbin/killuser.
UID sudo /sbin/killuser fi fi fi, next, create a file /sbin/killuser, owned by root, chmod it to 755 and paste in the following content #!/bin/bash # # Logs out the user calling this script # Get the PID of the loginwindow process for the user.
Learn more about jnuc 2017.
Sudo launchctl windows 7 home premium slow performance bootout gui id -u username ) or sudo launchctl bootout user id -u username ).This would be a pain if you wanted all users to be affected, but in my case, I only require a small number of users to be logged out on idle.This tells launchctl to teardown the users login session (gui specifically refers to the user's temporary login session, user specifies the users background processes).Timeout3600 if (stat -f u /dev/console) UID then if -e /tmp/backgroundUserLogout.Mac: Whether you share a Mac or you just want a quick way to log out and leave the computer, press.UID printf 0 ) -ge ( timeout ) then rm /tmp/backgroundUserLogout.
Using this command will keep you from having to mouse to the Apple menu and click "log out and by logging out immediately, you can turn over your Mac to the next person waiting to log in that much faster.
You can log yourself out without the sudo to test this.