As long as guests are unprivileged users that cannot change things outside of their home directory (/home/guest ?) this is relatively simple.
You can make a copy/backup of the freshly created guest user's home directory:
Code:
cp -rp /home/guest /home/guest_bak
and on startup remove the guest home directory and copy the backup back into place.
If you made a backup as "/home/guest_bak" (directory not file). Then you can make a script like:
Code:
#!/bin/sh
rm -f /home/guest
cp -rp /home/guest_bak /home/guest
Give that script a name like clean_guest.sh, move it to somewhere like /usr/local/bin, make it executable:
Code:
chmod +x /usr/local/bin/clean_guest.sh
Call it from inside /etc/rc.local (redhat) or similar init script and now any changes made or files copied will be gone and have a freshly built user home again.