I want user
foo to auto-login using LightDM (which has been used by Ubuntu since version 11.10). How would I do that?
An alternative to Alin's answer is to create a file
/etc/lightdm/lightdm.conf and add the following content:
[SeatDefaults] autologin-user=<YOUR USER> autologin-user-timeout=0 user-session=ubuntu # Uncomment the following, if running Unity #greeter-session=unity-greeter
Next time you start, auto-login should work like expected.
I can confirm that this works for 16.04.
Using your favourite editor, amend
autologin-user=xxxx to the file, for example:
[Seat:*] greeter-session=lightdm-gtk-greeter autologin-user=wmurphy
Remember to also set the Not asked to login option under Users and Groups.
Ubuntu 20.04 How To: automatic login of particular user (e.g. server login)
autologin for Ubuntu 20.04 and Ubuntu 20.04 LTS with XFCE4 this works:
(all as root using sudo)
0) set display manager to lightdm
check settings with
1) enable login without password
under Users and Groups
set the Not asked login option for the concerned user.
2) create and edit a new file /etc/lightdm/lightdm.conf.d/01_username.conf
[SeatDefaults] autologin-user=username autologin-user-timeout=0
replace "username" according; do NOT set autologin-user-timeout other than 0, does not work!
This solution worked fine with a nearly vanilla installation without gnome and without unity.
I just discovered that, I need to have ubuntu-desktop to be install before lightdm could function. This solved my issue when trying to get lightdm to actually login in without going in loop.
The reason for the system to go in loop may be because lightdm needs the ubuntu desktop before it may work.
sudo apt-get install ubuntu-desktop
For kali-rolling: (may work for other kali versions)
sudo sed -i '/^\[Seat:\*\]$/a autologin-user=YOUR_USERNAME\nautologin-user-timeout=0' /etc/lightdm/lightdm.conf
then create/add yourself to autologin group
sudo groupadd -r autologin sudo gpasswd -a username autologin
the command uses a seds insert after regular expression match feature to insert the line needed in the right section, you can alternatively just edit the file and add autologin-user= in the Seat section.