Before you continue...

Ubuntu is shipped with a guest session feature, which in most cases is the simplest - and preferred - way to let visitors log in without providing a password. Creating a static guest account, which is what this guide deals with, may be motivated in some rare cases.

Introduction

A guest account allows visitors to use the computer system without login credentials. Windows and other operating systems offer such limited accounts so that guests may use the computer. This guide shows several ways to set up such access in Ubuntu.

Security

Passwords are in place for a reason: to prevent unwanted and unauthorized access to the computer. By removing the password, or by changing the password to a known value, you are potentially creating a security risk that could be used by others to gain access to your system. Some of this risk can be mitigated by revoking privileges from passwordless users for administering the system, connecting to networks, sharing files, etc. Firewalls and other security measures can further alleviate problems. Be sure to take these risks into account as you implement any of the following procedures.

Deleting the guest password (null password)

By simply deleting the password for the guest account, Ubuntu will allow the user to log in locally without prompting for a password. Remote login attempts (such as through SSH, FTP, etc) will not be allowed to passwordless accounts by the default PAM configuration, making this setup relatively secure.

To begin, create a new user to serve as your guest account. You will be required to enter a password. Enter anything you like, as you will be deleting the password shortly. Be sure to revoke any privileges (such as Administering the system) that you do not want your guests to have.

Once the new account is created, open a terminal and enter the following command:

sudo passwd -d guest

Once this is complete, the guest account will have no password. Users will be able to log in from the login screen by merely clicking on the guest account.

Editing /etc/shadow

The default user on the Ubuntu Live CD is configured to not require a password. By replacing the password value of your guest user with the one from the Ubuntu Live CD, users will be able to log in by leaving the password prompt blank.

To begin, create a new user to serve as your guest account. You will be required to enter a password. Enter anything you like, as you will be changing the password shortly. Be sure to revoke any privileges (such as Administering the system) that you do not want your guests to have.

Once the new account is created, open a terminal and enter the appropriate command for your version of Ubuntu:

Ubuntu

gksudo gedit /etc/shadow

Kubuntu

kdesu kate /etc/shadow

Xubuntu

gksudo mousepad /etc/shadow

You will be prompted to enter your password (not the one for the account you are creating). After that is complete, a text editor will display the contents of the /etc/shadow file. You will need to locate the line which contains information for your guest account. The line will appear similar to this:

guest:$1$2EgYb2Fn6I$2EgYv4xZTUtb2Fn6I$2E.gYdgo8dq9EgYv:13720:1:99999:7:::

Once you locate the line for your guest account, you need to replace the text between the second and third colons. Erase the current value, and enter the following in its place:

U6aMy0wojraho

If your line began like the above example, it would now look like this:

guest:U6aMy0wojraho:13720:1:99999:7:::

Save the file and exit from the text editor. Once this is complete, you will be able to log in to your guest account from the login screen. When you select the account, you will be prompted for a password, but will be allowed to log in if you leave the space blank.

See Also

PasswordlessGuestAccount (last edited 2013-12-25 12:42:45 by gunnarhj)