236
Views

I was doing some browsing online about Kali Linux on the Raspberry Pi 3 and how to get it to allow SSH after a reboot. Right now, I have to connect a USB dongle to the device locally and type the username and password to login to Kali Linux . Once logged in it will connect to Wi-Fi and I can SSH in.

The reason is, Kali Linux doesn’t start Wi-Fi services until a user has logged in. So, we need to enable a user to login automatically upon boot to ensure that Wi-Fi will be enabled, connect to our access point and we can then SSH to the machine.

Enable auto-login for user root.

The user root is used by default with Kali Linux but we could technically use any user that we have added to our instillation for this step. We will be editing lightdm.conf found at /etc/lightdm/lightdm.conf.

nano /etc/lightdm/lightdm.conf

Locate the section in lightdm.conf labeled [Seat:*] and then #autologin-user= and #autologin-user-timeout=0 within it. We will be removing the comments and adding the user root. There is two sections that look similar so make sure that you are working with the right lines.

autologin-user=root
autologin-user-timeout=0

This is how they should look when you are done.

kaliautologin

Update: 8/12/17 – In a recent release something changes and you have to change an additional file.

Next navigate here and you will need to comment out a line in lightdm-autologin.

nano /etc/pam.d/lightdm-autologin

Locate the following line and comment it out with a #.

auth     required pam_succeed_if.so user != root quiet_success

To look like this:

#auth     required pam_succeed_if.so user != root quiet_success

Now you  just need to reboot and user root will login automatically.

reboot

Conclusion

I like this setup because I do a lot of my configurations via SSH. Having my Kali Linux instillation auto-login on my Raspberry Pi 3’s Wi-Fi makes it easier for me.

You can easily create a different user and use it for the auto-login or reverse this configuration in the future.

Let me know if you have any questions in the comments section below.

Article Tags:
· ·
Article Categories:
Tech
SDATIC

Web developer and former photographer by trade...gamer and all around tech enthusiast in his free time. Christoph started sdatic.com as a way to organize his ideas, research, notes and interests. He also found it enjoyable to connect and share with others who parallel his interests. Everything you see here is a resource that he found useful or interesting and he hopes that you will too.

All Comments

  • I followed the steps but it still wont auto login

    Peyton June 4, 2017 3:40 am Reply
    • Thank you for bringing this to my attention. I think a recent release changed the way auto login worked. I’ve updated the guide if you are still looking for this info.

      sdatic August 12, 2017 6:32 am Reply
  • I followed the exact steps but it still doesn’t work….
    I need your help
    thx

    Learner August 16, 2017 2:34 pm Reply
    • Hi Lerner,

      I just went through the process again on a fresh install of Kali linux on my RPI3 and it looks like it’s working for me.

      I’ve read a few posts about the lock screen still showing and usually they added or adjusted the wrong section in lightdm.conf. You can test if it was setup properly by trying to SSH to the RPI3 once it boots up. If you can SSH then it was setup properly and if you cant, it needs to be fixed.

      If you can SSH then you need to double check the lightdm-autologin file.

      Can you also share the version of kali that you installed? Incase I’m using a different version?

      sdatic August 16, 2017 4:52 pm Reply
      • Hey I know this a old post but are you able to assist as I can’t find any new ones but I cannot get it to work

        Coby bobin December 15, 2020 3:06 pm Reply
    • Lastly, the lines you need to update in lightdm.conf are in the section under [Seat:*]. There are other sections that say Seat but the specific ones you are looking for are under [Seat:*] and will be read differently than the other sections.

      sdatic August 16, 2017 4:56 pm Reply
      • Thank you very much for this distinction. This was my problem!!

        Network_Lucy October 7, 2017 2:03 pm Reply
      • ^^^^
        This was my problem, the auto login lines are in the conf file twice. making sure to change the ones under [Seat:*] instead of [Seat] did the trick.

        zach August 21, 2018 7:42 pm Reply
      • Woooooow man you save me, thanks a lot!!!

        Catalin December 18, 2018 11:12 am Reply
  • thank youu..it works

    lalo.com July 19, 2018 7:17 am Reply
  • This is a great article I struggle to find this information not knowing you had is all here! One problem though, I would like not so start the GUI but rather have the Raspi login root and enable wi-fi so I can ssh into it without using the CPU and memory that startx requires.
    So after getting the GUI to autologin I disabled the GUI by running
    `systemctl set-default multi-user.target`
    After doing so I need to login otherwise I don’t get the wi-fi to start therefore no ssh either 🙁
    Any idea on how to achieve the 1) wifi to start without a user to login or 2) autologin root but without starting the graphical interface?
    Thanks!

    Dan January 1, 2019 11:38 pm Reply
  • Pingback: Kali Pi Login - LoginSewa Step by Step

Leave a Reply

Your email address will not be published. Required fields are marked *