About my Kali Linux setup

The distro I use for doing the CTF challenges in HackTheBox is Kali Linux, because it has pretty much most of the tools that I need. Another great distro is Parrot OS, but I was already used to Kali by the time I found out about Parrot. First of all, I just setup a VirtualBox to run the latest Kali Linux image. The manual for those can be found by googling easily and I won't be writing about how to install it on the virtualbox, it should be fairly straightforward. This writeup is more about how I setup my Kali.

First thing I did is to disable the Kali from booting into a GUI. Why you may ask? Because I dont usually use it through the virtual machine, I prefer using it through my own local machine by SSHing into the virtual machine from my own.
The way to set it up to boot to command line is to edit the /etc/default/grub and change the values for GRUB_CMDLINE_LINUX_DEFAULT to "text" and then set GRUB_TERMINAL=console.
Afer that I just run sudo update-grub;sudo systemctl enable multi-user.target --force;sudo systemctl set-default multi.user.target
And then you're done. You can just boot into the GUI by typing startxfce4(If you are running the xfce4 version of Kali, it differs for other desktop managers).

After that you have to set it up so that you can SSH into it. First thing I do is setup a port forwarding option in my virtual machine. I set up guest port to be port 22(the ssh port) and then i set up Host port to be just a good number that works for me. The Host IP will be 127.0.0.1 and the guest IP will be whatever shows up when you type ifconfig on Kali, usually its 10.0.2.15, and the protocol for it will be the TCP protocol. After that I edit the /etc/ssh/sshd_config where I enable to log in as root and change the values for PubKeyAuthentication and PasswordAuthentication, depending on what I need. After that to start the ssh service just type in service ssh start and you should be able to ssh into the VM through the local machine

After everything is setup just type in ssh -p (whatever port you used) root@localhost on your local machine and you should be able to login and use Kali Linux through the comfort of your own machine.