#kali#avahi#ssh#kalisetup#systemctl#firstboot
Bonjour which I found out is build around mDNS won't start on wakeup. They are disabled in /usr/sbin/update-rc.d. Services as the avahi-daemon which enables mDNS, ssh and postgresql are disabled by default. For more information, see Kali networking.avahi-daemonMake
kali.localdiscoverable
avahi-daemon is included in the default configuration. However, it's not configured.
sudo systemctl start avahi-daemon # Start the agent right awaysudo systemctl enable avahi-daemon # Start it on every reboot
We still need to adapt the update-rc.d file so the service will be enabled on startup.
sudo sed -i 's/avahi-daemon.*/avahi-daemon enabled/' /usr/sbin/update-rc.d
sshEnabling the ssh agent involves the same steps required to enable avahi.
sudo systemctl start ssh # Start the agent right awaysudo systemctl enable ssh # Start it on every reboot
However, Kali Linux will prevent the service to restart despite we enabled it. To allow the service to start automatically, we're required to enable it in the /usr/sbin/update-rc.d file.
sudo sed -i 's/ssh.*/ssh enabled/' /usr/sbin/update-rc.d
And if everything went right, you'll should get ssh enabled back when running: cat /usr/sbin/update-rc.d | grep ssh.
DANGER: Change default ssh key to avoid a MITM attack
By defaults, some keys are generated and stored in the /etc/ssh/ directory. Move the keys and generate a new one.
cd /etc/ssh/ && sudo mkdir default_kali_keyssudo mv ssh_host_* default_kali_keys/
Next, we generate a new keys using:
sudo dpkg-reconfigure openssh-server # Generate some new ssh keys
Say something nice to your users
We'll configure kali to run headless, to save power and memory. This can be enabled using:
sudo systemctl set-default multi-user.target # opposite of graphical.targetsudo systemctl get-default # shows new default modereboot