Linux is a multi-user environment by default. Each user has his own folder in /home/TheUserName
Users are highly restricted outside that folder. They only have read access to most things.
By default, the Raspberry Pi comes with a single user called
pi. This user has a home directory called
/home/pi/. The catch: By default the
pi user has the ability to access anything through
sudo, which executes commands as root.
Make a new user. By default, new users don't have
sudo adduser guest
Now, when logging in (assuming terminal mode):
guest as a username, enter your password, then type
startx to get into the GUI. This user will not be able to modify anything outside
You may also want to change the default "Pi" password, execute this as
sudo passwd pi
Now your guest user will only be able to destroy their own /home/guest directory without damaging the rest of your Raspberry Pi.
You may also want to backup the fresh /home/guest. So that in case a guest messes the guest user up, you can simply recover it from the backup.
execute this as
sudo cp /home/guest /home/pi/backup/guest
To recover the guest account:
sudo rm -f -r /home/guest #Remove the guest folder.
sudo cp /home/pi/backup/guest /home/ #Copy the backup to where the guest folder used to be.
sudo chown -R guest /home/guest #Give "guest" ownership of the new guest folder.
If you want the guest account to always reset on startup, make sure that same script always executes on boot by putting it in