Ubuntu – How to disable the guest session

guest-sessionlightdm

How do I disable the guest session in Ubuntu 11.10 or higher? I don't want people to be able to use my computer without using a password to log in!

Best Answer

  • Updated: 2016-Aug

    For Ubuntu 16.04 LTS (15.10 or later)

    Adapted from: LightDM Ubuntu Wiki - Configuration

    • System provided configuration files in /usr/share/lightdm/ are not intended to be user editable. Instead users should use: /etc/lightdm/
    • Newer versions of LightDM (Ubuntu 15.10, or later) use [Seat:*] instead of [SeatDefaults]

    Just run this (once) at terminal:

    sudo sh -c 'printf "[Seat:*]\nallow-guest=false\n" >/etc/lightdm/lightdm.conf.d/50-no-guest.conf'
    

    To undo (restore Guest option), remove the file created:

    sudo rm /etc/lightdm/lightdm.conf.d/50-no-guest.conf
    

    For Ubuntu 14.04 LTS (up to 15.04)

    Adapted from: Ubuntu Forums - lightdm config files location in 14.04

    Just run this (once) at terminal:

    sudo sh -c 'printf "[SeatDefaults]\nallow-guest=false\n" >/usr/share/lightdm/lightdm.conf.d/50-no-guest.conf'
    

    You will no longer have 'Guest' as login option, on your next login.

    To undo (restore Guest option), remove the file created:

    sudo rm /usr/share/lightdm/lightdm.conf.d/50-no-guest.conf
    

    For Ubuntu 12.04 LTS (up to 13.10)

    Simplest method.

    Just run this (once) at terminal:

    sudo /usr/lib/lightdm/lightdm-set-defaults -l false
    

    You will no longer have 'Guest' as login option, on your next login.

    • This simply appends allow-guest=false to /etc/lightdm/lightdm.conf.

    • Should work from 11.10 onwards (since these use LightDM as well).

    To undo (restore Guest option):

    sudo /usr/lib/lightdm/lightdm-set-defaults -l true
    
  • Related Question