Remote Desktop and SSH access to Kali can be done in many ways. These are the most commonly used tools to connect to your kali and have an terminal or a full blown desktop experience
Remote Desktop (GUI) access to Kali
In Kali, open a terminal window and run the following commands.
If you already have a user or just wan to use root then skip the user creation path
- adduser tdh Add a user for remote login. Set a password and other info.
- usermod -aG sudo tdh Get an updated list of installable packages
- apt-get update Get an updated list of installable packages
- apt-get install xrdp Install the RDP server
- systemctl start xrdp Start the base XRDP server
- systemctl start xrdp-sesman Start the XRDP session manager
You can enable XRDP to start automatically on boots with the following commands:
- systemctl enable xrdp
- systemctl enable xrdp-sesman
Now open remote desktop on you windows computer
Enter the IP of the Kali machine and press connect.
leave the session on Xorg and press ok after filling in the credentials. If you encounter a blank screen the reboot the machine but to not log in. Only log in with remote desktop. This is due to multiple sessions. One remote and one local.
To solve this “second session” problem and allow as many sessions as you need, edit /etc/xrdp/startwm.sh and add these lines before the lines that test and execute Xsession. The $HOME/.profile is not part of the solution, but is something that should be run before starting the session anyway.
- unset DBUS_SESSION_BUS_ADDRESS
- unset XDG_RUNTIME_DIR
- . $HOME/.profile
Terminal Access using SSH
In Kali, open a terminal window and run the following commands:
- adduser tdh Add a user for remote login. Set a password and other info.
- usermod -aG sudo tdh Get an updated list of installable packages
- systemctl start ssh Start the base ssh server
You can use putty on windows to connect to kali over ssh
You can auto start with the command
systemctl enable ssh
And this conclude the guide Enabling Remote Desktop and SSH access to Kali. Do not forget to reboot and to upgrade your machine.