How to disable guest session ONLY from login screen?

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.


Possible Solution: (not tested)

Based on ArchLinux::LightDM

  • leave Guest enabled
  • stop Guest from successful login, by adjusting PAM behavior.

( see Enabling Autologin, but reversing the suggested logic )