JamesPoole
Posts: 3
Joined: Fri Jul 20, 2012 9:07 pm

Auto Login On Ubuntu Mate

Sun Apr 24, 2016 10:04 am

Im trying to find a way to auto login past the CLI login so I can execute a script automatically when I plug in the Pi.
I have found a few ways to do this online but I think they are all based around upstart and the method has changed since systemd has been introduced.
Can anyone help me here?

Cheers,
James

brucetexpeditefile
Posts: 24
Joined: Tue Jun 23, 2015 10:48 pm

Re: Auto Login On Ubuntu Mate

Sun Apr 24, 2016 3:27 pm

Haven't tried this on a PI but this is what I do on another ARM based SBC....

Only works if you are running lightdm...

Edit:

/usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf

Then add the following line at the end:

autologin-user=pi


Bruce

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: Auto Login On Ubuntu Mate

Sun Apr 24, 2016 3:38 pm

brucetexpeditefile wrote:Haven't tried this on a PI but this is what I do on another ARM based SBC....
Only works if you are running lightdm...
Edit:
/usr/share/lightdm/lightdm.conf.d/60-lightdm-gtk-greeter.conf
Then add the following line at the end:
autologin-user=pi
Isn't share supposed to mean you can share that with other systems, which may or may not need the same user to automatically log in? Granted, of course, that most people don't do that, and under 16.04 of Ubuntu, I can't get it to automatically log in even though the following is set:

/etc/lightdm/lightdm.conf

to:

[Seat:*]
autologin-user=whateverUser

brucetexpeditefile
Posts: 24
Joined: Tue Jun 23, 2015 10:48 pm

Re: Auto Login On Ubuntu Mate

Sun Apr 24, 2016 3:42 pm

Sorry, I missed the CLI entry. Here is how I do this on the PI as well as the other ARM computer running mate.

sudo vi /etc/systemd/system/getty.target.wants/getty@tty1.service
Find the line 'ExecStart=-/sbin/agetty %I $TERM
Change it to 'ExecStart=-/sbin/agetty --noclear -a pi %I $TERM

Change the pi entry to your login name.

Bruce

brucetexpeditefile
Posts: 24
Joined: Tue Jun 23, 2015 10:48 pm

Re: Auto Login On Ubuntu Mate

Sun Apr 24, 2016 3:45 pm

Converted the entry to a mailto link? Here is the file name.

Code: Select all

etc/systemd/system/getty.target.wants/getty@tty1.service
Note: I'm running 15.10. Thanks for the heads up on 16.04

Bruce

Return to “Advanced users”