10

So I just installed raspbian jessie lite on my pi 2. But I can't get it to login automatically. I first tried with raspi-config, which didn't work. Then after googling a bit, I found a tutorial which I'm suppose to edit inittab but when I try to access it, it's empty.

  • 1
    If you select the right option in raspi-config it should work. Anything using inittab won't. Indeed most of the tutorials before mid 2015 (and many after) are for SysV and won't work. Some will actually interfere with normal operation. – Milliways Jan 2 '16 at 0:57
  • @Milliways I have tried going into raspi-config, and changed the boot option to, console autologin but it doesn't work. – Yemto Jan 2 '16 at 8:31
7

I found a solution that uses raspi-config. I played around with it for a bit, and found something (NOTE: You may need to update raspi-config)

To enable Auto-login with raspi-config:

Run: sudo raspi-config
Choose option 3: Boot Options
Choose option B1: Desktop / CLI
Choose option B2: Console Autologin
Select Finish, and reboot the pi.

The pi should then log you in automatically. It as easy as, well, pi! :)

  • This should be the accepted answer. Worked perfectly. – slm Jul 2 '18 at 22:20
  • works like a charm,thanks man – FrontENG Sep 21 at 4:29
3

I have the same Rasbian Jessie on a Ras Pi 2.

Try THIS (solution via raspberrypi.stackexchange) will probably help!

Good luck

3

First create a new service similar to getty@.service:

# cp /lib/systemd/system/getty@.service \
     /etc/systemd/system/autologin@.service 

# ln -s /etc/systemd/system/autologin@.service \
        /etc/systemd/system/getty.target.wants/getty@tty8.service

then edit ExecStart, Restart and Alias values, like this:

...
ExecStart=-/sbin/mingetty --autologin USERNAME %I
Restart=no
...
Alias=getty.target.wants/getty@tty8.service

and finally reload daemon and start the service:

systemctl daemon-reload systemctl start getty@tty8.service

Note that if you exit tty8 session, you wont be able to use it until next reboot or manual start by systemctl, except if you leave Restart as ‘always’, but I highly recommend to avoid this according to security reasons.


source: fedoraproject.org/wiki

  • This solution didn't work at all. – piepi Jan 1 '17 at 3:20
  • 1
    it doesn't work if you blindly copy paste it, if that's what you mean – Havnar Jan 3 '17 at 12:45
2

The simplest way I have found, if using Raspbian, is to edit the raspi-config file: /etc/lightdm/lightdm.con and set the autologin-user= parameter.

Change: autologin-user=pi to autologin-user=username where username is your username.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.