How to Make Ubuntu Without Password Login Guest User

How to Make Ubuntu Without Password Login Guest User

Ubuntu is a secure and user-friendly operating system. It is popular among both desktop and server users. It is widely used in various sectors such as the marketplace, public sectors, schools, and colleges.

In public sectors, using a main user can be risky due to the potential for important data to be compromised. In such cases, creating a guest user with a password can be more difficult. Therefore, we might need to consider creating an Ubuntu login without a password. Before we start creating a guest user, we need to understand what a guest user is.

What is Guest User?

In some places like airports or malls, computers are available with stand. Anyone can use these resources and the computer's user is known as a guest user. In a computer, you can add multiple guest users but in a cell, users are limited. This type of user doesn't need a password to login.

For example, in a school, all the desktops are connected with one motherboard. It's possible for all users to work as a guest user without asking for a password. Most schools use Ubuntu as a desktop for students.

Perpose of Guest User

The main purpose of a guest user is to make the operating system publicly accessible for all users for testing and research purposes. It is used in colleges, school research labs, public places, and airports.

This type of user is not granted admin permission and can't modify any system settings. In the Ubuntu operating system, terminal does not show all data. From the terminal, root access is not available for this account.

If the admin user grants you sudo permission to access software and run it, this type of server is available for testing web applications, software, and tools remotely or for rent.

Required Security as a Ubuntu Guest User

Security is most important at this time. If there is a small bug in your system, it's risky as it could leak your data. Therefore, focus on your system's bug. If you are making the Ubuntu guest user on your hosting server or connecting Ubuntu server to your web application, do not allow the sudo permission to the guest user. If you do, someone could track your website details as a guest user.

If you are using Ubuntu in public mode with sudo permission, do not allow the admin permission for this user and do not share super user login credentials with the guest user. Do not use public IP addresses for this type of device, only connect to the internet with a NAT connection.

Create Guest User in Ubuntu

To create an Ubuntu guest user, first open the terminal on your system and switch to root user with the sudo su command. After switching, create a user and set the default password for the new user by following the command:

$ sudo useradd $USER

$ sudo passwd -d $USER

create guest user in ubuntu

In the following command, at $USER, input the username for this guest. In adding user command, do not use "adduser" because it's used for adding the sudoers user who can access all services including root. Instead, use "useradd" for creation. In the password setting process, use "--d" for default password. At this point, the new guest user is created but is not accessible without a password. We can allow this permission.

Make Ubuntu Without Password Login

To make Ubuntu without a password login, you need to modify the user credentials sudoers configuration file. Input the given command to open sudoers configuration with nano editor:

$ sudo nano /etc/sudoers

Inside of this file, we need to input the given script to make a user login without a password:

$USER ALL=(ALL) NOPASSWD: ALL
input no password login script for user

After inputting this script, press Ctrl + O and then press Ctrl + X to save the changes. Now, this newly created user is ready to use without any password.

Grant Sudo permission to User

Granting sudo permission to a guest user is optional and risky for your device. If you want to make the account public access over desktop for your team or students, you can input the following command as a root user:

usermod -a -G sudo $USER

At $USER, input the guest user's username then reboot the system with the sudo reboot command.

Test Without Password Login User in Ubuntu

After rebooting, you are redirected to the Ubuntu lock screen. Inside the lock screen, select the guest user and you are automatically logged in inside of guest mode.

You can run and test any software without any password but you cannot apply any administrative activity over this account. You cannot root login over the terminal from this user.