1. Never allow any Temporary User without a password to gain Access Control of your computer!
FIRST Make a policy to prevent the single user guest from making system wide changes
open text editor gksu gedit /etc/polkit-1/localauthority/50-local.d/10-desktop-policy.pkla
insert text
[guest-policy]
Identity=unix-user:guest
Action=*
ResultAny=no
ResultInactive=no
ResultActive=no
2. open terminal and start typing
sudo addgroup --system --quiet --gid 126 guest
sudo useradd -c Guest,,, -d /tmp/guest-home.UBUNTU -m -s /bin/bash -g guest guest
sudo usermod --uid 117 --gid 126 guest
to create blank password for this account:
sudo usermod --password U6aMy0wojraho guest
to create Not asked for password on login for this account:
sudo usermod --groups nopasswdlogin guest
Edit /etc/gdm/gdm.schemas
type:
gksu gedit /etc/gdm/gdm.schemas
and add guest to greeter/Include
default
<schema>
<key>greeter/Include</key>
<signature>s</signature>
<default>guest</default>
</schema>
now sudo restart gdm
NOTE: you will no longer be abel login to guest sessions from user accounts
this is the new guest session
and you will only be able to login from login screen any changes to this account will remain on logout until the computer restarts.
to restore open terminal and type:
sudo userdel guest
then sudo restart gdm
to copy your settings for guest session
sudo cp -R ~/.gconf/desktop /etc/gconf/gconf.xml.system/
sudo cp -R ~/.gconf/apps /etc/gconf/gconf.xml.system/
sudo chmod 777 -R /etc/gconf/gconf.xml.system/desktop
sudo chmod 777 -R /etc/gconf/gconf.xml.system/apps
It is not true that there is no way to recover them. It is true that there is no particularly reliable way to recover them. And with all the time that has passed, it is quite unlikely they could be recovered now; I'm really posting this answer for others who experience similar situations in the future.
When a file is deleted, such as files purged from /tmp, the data is not immediately destroyed, and it can persist for an extended time, and it can sometimes be recovered. See https://help.ubuntu.com/community/DataRecovery for information about data recovery in the context of Ubuntu.
Continuing to use your computer after you have deleted files that you want to recover significantly decreases the chance that recovery will be possible. So please do heed this warning (from DataRecovery):
You should NOT write to the failed device, as it can worsen a hardware
failure, and overwrite existant data in case of lost files.
Shut down the affected machine as soon as possible, and restart it
from a LiveCD or LiveUSB. Be certain that the "live" cd does not
automatically mount any partition or swap space.
In other words, stop using the Ubuntu system immediately, and only boot into either (1) a different system installed on the computer, or (2) better, a live CD/DVD or live USB flash drive.
(Thanks to Joseph Kern for pointing out the importance of emphasizing the need to stop using the system if there is to be good chance of recovering deleted files.)
Best Answer
Ubuntu's Guest account is a special type of account, which has its home directory set to the mount point of a
tmpfs
filesystem, which is used to store data which does not need to be persisted after a reboot.The data in
tmpfs
is stored in RAM backed up by the swap space, so it is likely the data had never been written to disk in the first place, so there's basically nothing to recover.More details on tmpfs.
If you're curious how guest account is set up, you can study
/usr/sbin/guest-account
, which is a shell script used to create/remove a guest account.