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.
2 Answers
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.
-
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.– IngoCommented Mar 5, 2020 at 18:13
-
@Ingo wpa_supplicant should be available also in kali linux. I edited answer.– MatejCommented Mar 5, 2020 at 18:22
-
1OK 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 emptyssh
file in the fat32/boot
directory will also enable thesshd.service
on Kali Linux.– IngoCommented Mar 5, 2020 at 18:33
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.
-
-
1The 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.– IngoCommented Mar 5, 2020 at 18:23
touch ssh
in boot partition of the SD card.