How to Disable the Guest Session Completely in Ubuntu

The Security Liability

Historically, many Ubuntu desktop installations (specifically those utilizing the LightDM display manager) featured a “Guest Session” by default on the login screen. This allowed anyone to walk up to your locked computer, click “Guest,” and instantly access a restricted, temporary desktop environment without needing a password. While intended for letting a friend quickly browse the web, this feature presents a glaring physical security liability in an office or public environment. Even though the guest account is sandboxed, it still grants an unauthorized physical user access to your computer’s hardware, network connection, and potentially exploitable local vulnerabilities.

Removing the Guest Account

To lock down your machine and disable the Guest Session completely in Ubuntu, you must explicitly forbid it within the display manager’s core configuration files.

You cannot remove the guest account via standard user settings; you must use the terminal. Open your terminal by pressing Ctrl+Alt+T. You need to create or edit a specific configuration file for LightDM. Type exactly: sudo nano /etc/lightdm/lightdm.conf.d/50-no-guest.conf and press Enter (provide your password). The file will likely be completely blank. Carefully type the following two lines into the file:
[Seat:*]
allow-guest=false
Press Ctrl+O then Enter to save the file, and Ctrl+X to exit the nano editor. To apply this crucial security change, you must restart the display manager, which will log you out. Save any open work, then type: sudo systemctl restart lightdm. When the login screen reappears, the Guest Session option will be permanently gone.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.