0

I've been using Raspbian for a while now. I came across Kali Linux and I want to use it. I know how to install it, but I don't want to use a HDMI monitor with a keyboard and mouse. Is there a way to headlessly set up Kali Linux without the need of the monitor combo? I also need to be able to SSH into it.

9
  • You can enable ssh using touch ssh in boot partition of the SD card.
    – Matej
    Commented Mar 2, 2020 at 14:53
  • And how do I connect it to the internet?
    – SkyPlayX
    Commented Mar 2, 2020 at 15:02
  • Using ethernet.
    – Matej
    Commented Mar 2, 2020 at 15:03
  • Any other way? I need the pi to be portable.
    – SkyPlayX
    Commented Mar 2, 2020 at 15:05
  • And please write this as an answer.
    – SkyPlayX
    Commented Mar 2, 2020 at 15:06

2 Answers 2

1

Easiest way is to connect raspberry pi using ethernet and enable ssh by default creating ssh file in boot partition. On linux it can be done using touch /media/$USER/boot/ssh

If you don't want ethernet you can setup WiFi using wpa_supplicant.conf file which location is /etc/wpa_supplicant.conf

Example of WiFi config from raspberrypi documentation:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<Insert country code here>

network={
  ssid="<Name of your WiFi>"
  psk="<Password for your WiFi>"
}

More info here: https://www.raspberrypi.org/documentation/configuration/wireless/headless.md This link is raspbian documentation but wpa_supplicant should be available also in kali linux.

3
  • The link you have given as reference is using Raspbian. Are you sure that is all the same with Kali Linux? If so you should mention it in your answer.
    – Ingo
    Commented Mar 5, 2020 at 18:13
  • @Ingo wpa_supplicant should be available also in kali linux. I edited answer.
    – Matej
    Commented Mar 5, 2020 at 18:22
  • 1
    OK yes, wpa_supplicant should also be available in Kali Linux. But you should correct the conf location to /etc/wpa_supplicant/wpa_supplicant.conf. That's on the ext4 partition. For me it is still unclear if an empty ssh file in the fat32 /boot directory will also enable the sshd.service on Kali Linux.
    – Ingo
    Commented Mar 5, 2020 at 18:33
1

Try chroot. Plug the SD card into an existing Linux machine. Mount the "rootfs" partition. Let's say the mount point is /media/user/rootfs. Then you would type sudo chroot /media/user/rootfs. Now you can do everything you want, for example install an SSH server and configure the WiFi. As far as I know, WiFi is set up in the /etc/wpa_supplicant/wpa_supplicant.conf file, but I'm not sure. You'll have to look that up.

3
  • Is it possible to do it on Windows?
    – SkyPlayX
    Commented Mar 2, 2020 at 15:29
  • 1
    The chroot command is not available on Windows. You can still try connecting the SD card to a vm. Maybe git bash comes with chroot, you can also try that. Commented Mar 2, 2020 at 15:32
  • You cannot do much with a simple chroot. Before you have to mount --bind ... important virtual filesystems like /proc, /dev, /sys etc.
    – Ingo
    Commented Mar 5, 2020 at 18:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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