how do I make an applescript to logout?

xaqintosh

Master of Reality
that is exactly what I need: an applescript that logs out of the user. it is for my parents, who want everything to be "easy", so I'll just stick it in the dock or the desktop as an app. thanks.
 
I'd like exactly the same script, but for a different reason. I want to make it a startup item for users that shouldn't be able to login via the GUI locally. These users should only be able to access my computer via FTP.
 
RHITMacMan, you should use testuser's FTPOnly script to create users that are only able to login via FTP or SSH, and who don't even appear on the login screen.

Depending on your level of OS X expertise, you can also just do it manually with NetInfo Manager.
 
Originally posted by Gwailo
RHITMacMan, you should use testuser's FTPOnly script to create users that are only able to login via FTP or SSH, and who don't even appear on the login screen.

Depending on your level of OS X expertise, you can also just do it manually with NetInfo Manager.

Those are the exact scripts that I am using. If you check the thread you'll notice the discussion of how any user you create can simply type in their username/password at the GUI login screen and login locally. If you've used testuser's scripts to create a user for FTP access, try using the user/pass of this FTP user and see that you can actually login.
 
I've been looking around and have yet to find anything. I did find Applescript methods for shutting down and restarting the computer, but not logging out. I can even shutdown or restart the computer from a shell script, but not logout. If anyone does know of a way or have an idea, I'd really appreciate it. As I'm sure xaqintosh would as well.
 
This should the trick. It is a double-clickable shell script that will log out the current user.

Download the attached file, rename from attachment.php to Logout.dmg.zip. Expand and enjoy.

RHITMacMan--you can make it a login item for the users you want to deny access to the GUI, but it can be bypassed by a savvy user by holding down the shift key as they login. But it should provide you with a marginally secure way to prevent users from logging in locally on your machine.
 

Attachments

  • logout.dmg.zip
    46.6 KB · Views: 63
Originally posted by xaqintosh
thanks! :)

Actually, my previous offering was just a pinch of incense designed to meet your immediate need. Now I have revised my previous (feeble) attempt and created what you had originally requested: an AppleScript applet that logs out the currently logged-in user. The implemenation is much friendlier in that it requires user confirmation before logout! I'm sure parents and relatives will find it much more intuitive and usable.
 

Attachments

  • logout.dmg.zip
    84.1 KB · Views: 28
Back
Top