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
I have an open PAM-related question right now, so I can say from experience that modifying any PAM modules can quickly get very specific to the version of Ubuntu you are working with. What works for Precise, may not always work for Quantal, etc.
That said, the answer to your question probably does not require any changes to PAM modules. In fact, you almost have it.
Add this line to the bottom of /etc/lightdm/lightdm.conf
greeter-allow-guest=false
My lightdm.conf
looks like this:
[SeatDefaults]<br>
greeter-session=unity-greeter<br>
user-session=ubuntu<br>
greeter-allow-guest=false<br>
Now restart your machine.
On 12.10, I tested that this removes Guest from the user menu, but leaves it as a manual option once logged in on another account.
Pretty sure this will work for you on 12.04 as well.
Best Answer
This has become much easier in 11.10.
First you need to create a folder:
sudo mkdir -p /etc/guest-session/skel/
. The -p switch creates /etc/guest-session so you can place /skel in it in one go. Now you just add the files you want to /etc/guest-session/skel and it will be copied onto the guest account whenever it's created.The program that sets this up is /usr/sbin/guest-account in case you want to learn more about what's going on.
The tutorial CustomizeGuestSession elaborates on this topic. In particular it describes how you can create a "special purpose user" for a convenient way to customize the guest session appearance and behavior, without having to know which files to edit.