How to Create Guest Account on Ubuntu 25.04

Ubuntu 25.04 doesn’t offer built-in guest sessions by default, but you can still create a separate limited user for temporary or controlled access. A guest account lets someone use your machine without seeing your private data or changing your system settings.

Step 1: Create a limited user

Start by adding a new user account. This account will serve as the guest, with its own home folder and no admin access:

sudo adduser guest user

 

Set a password when prompted. You can skip the full name and other details by pressing Enter.

Step 2: Revoke admin rights

To ensure the guest user stays restricted, remove it from any privileged groups like sudo:

sudo del user sudo

This prevents the guest from making system-wide changes.

Step 3: Limit access to your files

By default, other users may access your home directory. You can fix this by adjusting permissions:

sudo chmod 750 /home/yourusername

Replace your username with your actual account name. This protects your private files from being read by the guest.

Step 4: Assign a login shell

The guest user needs a shell to use the terminal. You can keep the default shell or assign a different one:

sudo usermod -s /bin/bash guestuser

Later, you can change it to /usr/sbin/nologin to block access completely.

Step 5: Clean up the guest’s files optional

If the guest user is for short-term use, you might want to wipe its files afterward. This is helpful for shared systems:

sudo rm -rf /home/guestuser/*

You can also automate this cleanup with a cron job or a logout script.

Optional Step: Disable GUI login

In some cases, you may want to prevent the guest user from logging in through the graphical interface:

sudo usermod -s /usr/sbin/nologin guestuser

This disables both terminal and desktop login but keeps the user on the system for future use.

Share:

More Posts

How to Install Maven on macOS 2025

What you will read?1 Check for Java Installation2 Install Homebrew (If Not Installed)3 Install Maven via Homebrew4 Verify Environment Variables (Optional)5 Create a Sample Maven

How to Use Google SMTP Server

What you will read?1 Step 1: Enable SMTP Access in Gmail2 Step 2: Secure Connection with TLS3 Step 3: Send an Email via SMTP4 Step

how to install wine on RHEL

What you will read?1 Check RHEL version and CPU architecture2 Update system and install base tools3 Verify subscription and enable CodeReady Builder4 Enable EPEL repository5

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments