How can I disable automatic login on a LiveUSB?

In the live Ubuntu 12.04 there is 1 graphical and 6 console automatic logins.

To disable the graphical login, use a text editor like GEDIT sudo gedit /etc/lightdm/lightdm.conf

Change the line:

autologin-user=ubuntu

to

autologin-user=

and append the following to make the login greeter show up:

greeter-show-manual-login=true

This is how you can disable the 6 console logins:

There are 6 files that specify the automatic logins. They are /etc/init/tty1.conf to /etc/init/tty6.conf.

First rename these files to any unused names, for example to /etc/init/custom-tty1.conf to /etc/init/custom-tty6.conf.

Then edit each file, replacing the line beginning with "exec" as shown below. Match the tty number to the number in the file name. For example, for file /etc/init/custom-tty1.conf, replace

exec /bin/login -f ubuntu </dev/tty1 > /dev/tty1 2>&1

with

exec /sbin/getty -8 38400 tty1

I just discovered that an Ubuntu live USB creates a user named Ubuntu with an id of 999, and a user named root with an id of 0. The assumption that the user is root is almost correct. It appears as if the user Ubuntu is granted super user privileges.

The steps required to remove this user is as follows:

  1. Press Control+Alt+Fx where x is any number from 1-5. This will give you a terminal you can work with. It will already be logged in as Ubuntu.

  2. Type sudo passwd root. This will prompt you for a root password. Anything you enter here will become the root password. Enter the same password twice.

  3. Login as root by typing su, press Enter and then entering the password from step 2.

  4. Make the changes noted in the answer above.

Note: You won't need to enter sudo in front of the commands since you are root!

Press Alt+F7 to get back to the graphical interface.

  1. Click on the gear/cogwheel in the upper left corner of the screen, select 'system settings -> user accounts'

  2. Create at least 1 administrative user. Set automatic login to [off] (if it's not set already) You may need to click on the lock in the upper left of this window.

  3. After making changes, Reboot the system by clicking the gear and selecting shut down. Select Reboot at the next screen.

  4. When the Ubuntu user autologs into the graphic screen select the gear at the top, then select log out.

  5. Press Control+Alt+Fx again (1-5). You should be prompted to log in.

  6. Log in as root with the root password you entered at step 2.

  7. Type deluser --force ubuntu ubuntu then press Enter.

  8. Press Alt+F7 to return to the graphic interface.

  9. Shut down and restart the system and all should be well. Your administrative user name is automatically entered into the sudo users table so you can use sudo to execute system commands. Don't use the root user for normal work. It just complicates system recovery efforts.

Now, if only I could figure out how to remove the Try or Install window my usb stick would be perfect.