Kali Linux Installation on Headless Raspberry Pi

Defsecone
3 min readJun 24, 2020

--

This article elaborates about Kali Linux installation on Raspberry Pi (Headless) and enabling WIFI and SSH. Headless installation is a process of installing the operating system(in our case Kali Linux) on Raspberry Pi without monitor, keyboard or mouse connected.

I was installing Kali Linux and enabling WiFi headless and accessing it through SSH by updating the wpa_supplication file as per various articles and sources till Kali Linux 2019 versions on my Raspberry Pi, but suddenly i was not able to do the same on Kali Linux 2020.b (https://www.offensive-security.com/kali-linux-arm-images/). There may be method for that to work but I found very less information about it on online forums and articles, hence I decided to see an alternate path and found one to install and enable WiFi headless on Raspberry Pi.

To start with remove the SD card from the Raspberry Pi and use a card reader and plug it into the Laptop. Download the latest Kali Linux ARM images from https://www.offensive-security.com/kali-linux-arm-images/. The image has to be written on the SD card inserted to laptop, this can be done using tools like Rufus (https://rufus.ie/). Add the image to Rufus tool and start writing as below.

You may need to format the SD card as part of process, hence it is recommended to remove files before starting this process. Once the image has been written successfully, mount the SD card to the Kali Linux machine running on your laptop since the partition is only visible on Linux systems.

There are few modifications that has to be done before inserting the SD card back to Raspberry Pi.

As a first step add a connection profile to /etc/NetworkManager/system-connections/ with the WiFi details as below. You can use this link as a template https://pastebin.com/edC8YcwT

Modify the SSID and PSK on the file as required and change the permission of the file as below

Update the NetworkManager.conf (/etc/network/interfaces) to allow NetworkManager service manage networks as below

Ensure that you add the wlan0 interface to /etc/network/interfaces file as below

This will now allow the Raspberry Pi to connect to the WiFi configured, however the WiFi gets connected only after user login, since this is going to be headless you may not be able to login hence you need to use auto-login option so that it works unattended and headless, to do that modify the lightdm.conf located at /etc/lightdm/lightdm.conf and uncomment the lines as below (Note: also uncomment autologin-user and autologin-user-timeout on [Seat:*] section)

We are almost done!. Now remove the SD card from the PC and insert it on Raspberry Pi and power it up. If all goes well you should have the Raspberry Pi connected to the WiFi network and you should be able to SSH to it as below :)

--

--