force an automatic logout when logging in

Discussion in 'macOS' started by SookieSam, Aug 24, 2011.

  1. SookieSam macrumors newbie

    Aug 24, 2011
    Victoria, British Columbia
    Hello MacOSX users,

    I'm in a situation where I would like to be able to initiate an unconditional logout when a particular (evil) user attempts to log into one of my iMac computers.

    I have both a login and logout script defined on my iMacs, so what I would like to do is add some code to the login tcsh shell script to perform this function.

    I can determine the UserID of the "evil" person(s) attempting to login no

    Question is, what do I do next? How do I tell MacOSX to abort the login process and return to the login screen?

    Has anyone here ever tried doing anything like this before?

    I've been playing around with the killing of UNIX processes but not sure which one I should be killing?

    Also tried creating an AppleScript application that does an unconditional logout by emulating the pressing of the key combination "command:shift:eek:ption:Q" but I can't get it to work during login process.

    (my created app works fine if run manually once login process has completed)

    Fishing for ideas here ... any takers?

  2. Hansr macrumors 6502a

    Apr 1, 2007
    Why? Just delete the account.

    EDIT: Removed the solution as I think you're just trying to piss someone, who has a legitimate reason to use the computer, off.

Share This Page