Why you can trust ZDNET : ZDNET independently tests and researches products to bring you our best recommendations and advice. When you buy through our links, we may earn a commission. Our process

'ZDNET Recommends': What exactly does it mean?

ZDNET's recommendations are based on many hours of testing, research, and comparison shopping. We gather data from the best available sources, including vendor and retailer listings as well as other relevant and independent reviews sites. And we pore over customer reviews to find out what matters to real people who already own and use the products and services we’re assessing.

When you click through from our site to a retailer and buy a product or service, we may earn affiliate commissions. This helps support our work, but does not affect what we cover or how, and it does not affect the price you pay. Neither ZDNET nor the author are compensated for these independent reviews. Indeed, we follow strict guidelines that ensure our editorial content is never influenced by advertisers.

ZDNET's editorial team writes on behalf of you, our reader. Our goal is to deliver the most accurate information and the most knowledgeable advice possible in order to help you make smarter buying decisions on tech gear and a wide array of products and services. Our editors thoroughly review and fact-check every article to ensure that our content meets the highest standards. If we have made an error or published misleading information, we will correct or clarify the article. If you see inaccuracies in our content, please report the mistake via this form.


How to enable guest sessions on an Ubuntu desktop

If you need to allow others to access your Ubuntu desktop, you might consider enabling the Guest Session feature. This way, those users don't have access to your data.
Written by Jack Wallen, Contributing Writer
Reviewed by Min Shin
Woman working on her laptop in an office
Carlina Teteris/Getty Images

Your privacy is important and nearly every Linux distribution is filled with features, tricks, and underpinnings that take the security of your information very seriously. Take, for instance, the idea of the guest session.

The concept is a special login for your operating system that allows others to use the machine, without having access to any of your data. At the same time, no information would be saved between guest sessions. In other words, anyone could use your computer, and -- once they logged out of the guest session -- any and all data collected during the session would be automatically trashed.

Also: Ubuntu 22.04.2 is as predictable as an operating system can be... and that's a good thing 

That's why the guest session should be considered important to anyone who sometimes (or regularly) has to share a computer with other users. This could even be employed by small businesses that need kiosk-like computers for customers to use.

Although Ubuntu doesn't ship with its Guest Session feature enabled by default, it's pretty easy to add. Let me show you how to do just that.

How to enable Guest Session


The only things you'll need for this are a running instance of Ubuntu desktop (from 16.04 to the latest release) and a user with sudo privileges. That's all you need. Let's make it happen.

1. Install LightDM

The first thing we must do is install the LightDM login manager. Log in to Ubuntu and open a terminal window. At the prompt, paste the following command:

sudo apt-get install lightdm -y

2. Select LightDM as the default login manager

During the installation of LightDM, you'll be prompted to select the default login manager. 

Also: Ubuntu Linux tries for the office desktop

Using the arrow keys on your keyboard, select "lightdm," tab down to OK, and hit Enter on your keyboard.

The LightDM configuration window.

You must select "lightdm" as your default login manager to enable Guest Session.

Screenshot by Jack Wallen/ZDNET

3. Configure LightDM

Once LightDM is installed, you must configure it to enable the Guest Session feature. For that, issue the command:

sudo nano /etc/lightdm/lightdm.conf.d/40-enable-guest.conf

In that file, paste the following contents:


Save the file with the CTRL+X keyboard combination.

4. Reboot and enjoy

With the LightDM software installed and configured, reboot the machine. Once the login manager appears, you'll see Guest Session listed. To use the new feature, click Guest Session, and then click Log In. There is no password for the Guest Session. 

Also: How to install Ubuntu Linux (It's easy!)

Once the desktop is presented, the user will be presented with a warning that all data created during the session will be deleted upon log out and that, should they need to save any data, it should be saved to an external device (such as a USB flash drive).

The LightDM log in manager with guest session enabled.

Click Guest Session and you'll then be prompted to click Login.

Screenshot by Jack Wallen/ZDNET

The Guest Session will look and feel like a regular session and even has a home directory. One thing to keep in mind, however, is that every single time you enter the Guest Session, you'll see the Temporary Guest Session warning and will have to walk through the welcome wizard.

If that becomes problematic, you can remove the initial setup tool with the command:

sudo apt remove --autoremove gnome-initial-setup

Of course, the above command must be run as a regular user with sudo privileges. However, once the command completes, log out, and log back in to the Guest Session account. You'll still see the Temporary Guest Session warning, but not the initial setup wizard.

The guest session warning informing users no data will be saved.

Every guest user will see this warning.

Screenshot by Jack Wallen/ZDNET

And that, my Linux-using friends, is how you can enable the Guest Session account and retain your privacy, no matter how many people need to use your computer.

Editorial standards