Pseudo Guest User Delete list

Morningside
Contributor II

I have come to the conclusion that try to use the Guest User account in a school setting, and managing it via jamf policies and profiles is more trouble than it is worth. So what I'd like to do is create a password-less user called 'Student' and manage it as if it were the Guest account. Is there anyone here who has done this already and has a logout script they can share? If not, I am prepared to slog my way thru it and then share what I come up with back to the community. Here is a list of things I am thinking of including right off:

  1. delete all chrome browser history, cache, and cookies
  2. delete the contents of the desktop, the documents folder, and the download folder

I already disallow the use of mail, messages, safari, and other apps via software restrictions, so that should not be a problem.

Anything else?

4 REPLIES 4

Morningside
Contributor II

It occurs to me that the chrome piece of it can be elegantly handled by leveraging chrome's own mechanisms to delete all browsing data between launches. Probably there is a way to set that with a plist.

ryan_ball
Valued Contributor

@Morningside If the guest users home is at /Users/guest, then this should work:

#!/bin/bash

/usr/bin/pkill -a -i "Google Chrome"
rm -Rf /Users/guest/Library/Application Support/Google/Chrome
rm -Rf /Users/guest/Desktop/*
rm -Rf /Users/guest/Documents/*
rm -Rf /Users/guest/Downloads/*

exit 0

Morningside
Contributor II

@ryan.ball Thanks for the script! I am starting in on a new project to create my own guest-like account which I am calling 'Student'. So I'll be changing 'guest' to 'Student' in your script. Right now tho, I am still trying to figure out how to create a passwordless local account. In Jamf, the policy requires a password!!

ryan_ball
Valued Contributor

@Morningside I think you can do it like so:

#!/bin/bash

/usr/local/bin/jamf createAccount -username "student" -realname "Student" -password "" -home "/Users/student" -shell "/bin/bash"