Skip to content
Unix Server Solutions
  • Server
  • Apple
  • Database
  • Ubuntu
  • Linux

Ubuntu – How to disable autologin in Lubuntu

auto-loginlubuntu

I like to switch sometimes between Lubuntu and Ubuntu 2D on my laptop. But I especially like to choose which one I will use in the session I am about to start. But the only way of choosing is start the laptop up, and the last used thing will show up (as it should), then log out completely, and choose the other thing from the login menu.

I have spent a lot of my lifetime using Windows, and always I was asked a login BEFORE I actually could do anything. Now I think it is weird that anyone can log into a password-protected account without giving any passwords, as long as the last user was the Admin. Also: will logging out before shutdown help?

Here is my default.conf file.

Best Answer

Try this. To disable autologin, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command below.

sudo leafpad /etc/lxdm/default.conf

In the fist few line, you will see something like autologin=username change it to the original state of # autologin=dgod. Save the file, and then reboot your machine.

Also try to go to System Settings --> Users and Groups, click on change next to Password

enter image description here

Make sure that the box is unchecked next to Don't ask for password on login enter image description here

Try to edit sudo leafpad /etc/lightdm/lightdm.conf with these contents:

Remove or comment out the following lines

autologin-user=username
autologin-user-timeout=0

For 14.04 everything works. The /etc/lightdm/lightdm.conf doesn't exist in 14.04, but the other ways work. See image below:

enter image description here

enter image description here

Related Solutions

Ubuntu – How to enable autologin for the user account when the option is not there

Found the cause of this one. I fired up a new blank VM with a view to installing Ubuntu on it and seeing if the issue persisted in a fresh install.

During the install process, on the "Who are you?" screen you get the option to "Log in automatically". You also get the option to "Encrypt my home folder".

I have encryption enabled on the original VM. It appears that you cannot use automatic login if you are using home folder encryption. (The installer will not let you select them both together, it automatically deselects the auto login if you select encryption and vice versa).

I found this post about deactivating home folder encryption. http://ubuntuforums.org/showthread.php?t=1134121

From my original account i did the following:

I opened a terminal (Ctrl-Alt-T).

I issued sudo su to become root.

I issued cp -rp /home/user /home/user.backup to take an unencrypted copy of the home directory (replacing user with my actual username).

while doing the copy i received the error message:

cp: cannot stat /home/tom/.gvfs': Permission denied

I just ignored it. Everything seemed to be copied ok.

I issued gedit /etc/default/grub so I could comment out the lines

GRUB_HIDDEN_TIMEOUT=0

GRUB_HIDDEN_TIMEOUT_QUIET=true

I saved, exited gedit and issued update-grub to update GRUB.

I rebooted the VM and selected

Ubuntu, with Linux 3.2.0-26-generic-pae (recovery mode)

from the boot menu. When the Recovery Menu appeared I selected "root".

From the prompt I issued mount -rw -o remount / to remount the root partition with read/write permissions.

I issued rm -rf /home/user to delete the home folder (replacing user with my actual username).

I did not use apt-get to remove ecryptfs-utils as I might want to encrypt the home folder of another user account at a later date.

I issued cp -rp /home/user.backup /home/user to recreate the home directory from the unencrypted backup (replacing user with my actual username).

I issued rm /home/user/.ecryptfs and rm /home/user/.Private to remove the symlinks (replacing user with my actual username).

I issued rm -r /home/.ecryptfs/user to remove the encrypted home folder (replacing user with my actual username).

I issued reboot now to reboot the VM. Doing this returns you to the Recovery Menu; if you wait a few moments it will reboot.

I selected

Ubuntu, with Linux 3.2.0-26-generic-pae

from the boot menu (i.e. to boot normally).

Once booted I went into User Accounts. The auto-login option was now available. I unlocked, cleared up the test accounts, enabled auto-login and rebooted. It worked.

I used gedit to edit /etc/default/grub and return it to normal. (Don't forget to update-grub after editing.)

Ubuntu – Autologin on lubuntu 14.10

According to the Lubuntu Wiki https://help.ubuntu.com/community/Lubuntu/Boot_Install_Login#For_release_12.04_and_on_.28LightDM.29

you must

For release 12.04 and on (LightDM)

You will need to create an /etc/lightdm/lightdm.conf with these contents: (do this as root)

[SeatDefaults]

autologin-user=<YOUR USER>

autologin-user-timeout=0

user-session=Lubuntu

greeter-session=lightdm-gtk-greeter

It appears that what you have tried and say does not work is similar but not the same as this solution.

Related Question
  • Ubuntu – How to enable autologin for the user account when the option is not there
  • Ubuntu – Autologin on lubuntu 14.10
  • Ubuntu – Lubuntu Taskbar missing