I need a way to securely wipe guest accounts accounts off of my machine. On OSX, guests are automatically deleted on logout, with this deletion being done using the "RM" command. I need a way to alter this to either the secure form of "RM" (RM -p I believe?) or to use "SRM" instead.

Alternatively, workarounds would be highly helpful. Currently, I believe it may be possible to replace "RM" with "SRM" on a system level, albeit I am unsure if it is plausible or possible. Other workarounds I have considered is manually deleting the files (it should be possible to run a script on logout that does this?) or, on startup, find a way to potentially write over the HDD sectors with 0's and 1's.

In summation....

Is it possible (and if so, how) to delete guest account data securely?

Note I am tagging this under OSX, UNIX, and LINUX because I feel that an answer would be valid for all platforms of this type. This was also Xposted on Stack Overflow

  • 1
    Please don't cross-post on multiple StackExchange sites. So you know, that is prohibited by site rules. In the future, you can click flag (underneath your question) to flag it for moderator attention and ask the moderator to migrate the question to the appropriate site. Also, FYI, this site is the right place to ask questions about how to securely delete guest accounts in Mac OS X (good question!), but this isn't really the right place to ask Linux questions.
    – D.W.
    Dec 12, 2013 at 9:34

1 Answer 1


It's kinda possible. You can use a logout hook to run a script when a user logs out. This will also be run when the guest user is logged out, too. All you would need to do is create a script that SRMs the guest home folder when the Mac is logged out of or shut down.

This command will initiate a login hook (presuming that /usr/local/bin/logoutscript exists and is chmodded correctly so that the script is executable)

sudo defaults write com.apple.loginwindow LogoutHook /usr/local/bin/logoutscript

You can easily write a shell script that would SRM the Guest account home folder.

  • What happens about temp files? Are these located inside of the home folder as well, or...? Dec 11, 2013 at 21:39
  • @NathanLafferty Most applications' temporary files will wind up contained in the User folder, typically in ~/Library. However, some will occasionally put things into the /Users/Shared folder, and the guest user does have the ability to write here, and files the guest user leaves here will not be deleted on logout. You might want to engage in some permissions adjustments to prevent this.
    – GBorreson
    Dec 11, 2013 at 23:40
  • Not sure about the guest account, but, normal users have temp and cache files stored beneath /var/folders/ as well.
    – Kent
    Dec 12, 2013 at 1:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .