Kali Linux Remote Access
Remote desktop Linux on Kali is compatible with many systems and devices (like Remmina, VNC server, Xrdp server, etc.)
For example, Xrdp provides a very convenient session manager called “Xrdp sesman”. Xrdp sesmen lets users manage user sessions through authentication options, allowing for greater control over who can access the remote machine!
Some remote access tools even offer convenient port forwarding options (port forwarding directs outside traffic to the correct server within a local network.)
But, on a select variety of those operating systems, users may only have access to a minimal installation, and could lack (at times) direct access to GUIs like WSL.
However, that doesn’t mean your Kali Linux RDP experience can’t be flexible and effective. Kali RDP and SSH access can be done in a variety of ways, and below we’ve outlined the most popular tools to enable remote desktop Kali Linux options. These tools allow Kali-users to use a terminal, or access complete remote desktop control.
What can you do once you have remote access to Kali Linux? Control and manage remote device files, settings, and more! It’s not only a convenient tool, but a crucial one in the modern era of remote work.
Being that Kali (and the alternative Linux machine OS, Ubuntu) can function with a plethora of Kali Linux remote desktop clients like Remmina, VNC server, Xrdp server Zoho Assist, and more… It’s a great idea for users of Linux machines to enable remote desktop Kali capabilities.
Please note: It’s important to ensure the download/installation/updating of all necessary packages is complete before attempting to connect a remote desktop Kali Linux to Windows machines (or vice versa).
The tool, Sudo Apt, will come in handy for remote Linux package help. Once the user runs the Sudo apt-get update command, any and all required packages will download directly from the web.
It’s critical to check that all apps/tools assisting in Windows remote desktop from Kali Linux connections are compatible, as well.
Setting up RDP with XFCE
An easy method to gain access to a remote access Kali Linux GUI is by installing XFCE, and establishing RDP. XFCE initially began back in 1966. The creator of XFCE, named Oliver Fourdan, first launched the program in the mid-60s.
He wanted to provide a newer version of Linux operating systems to run on the desktop environment. XFCE, originally, stood as an acronym symbolizing X forming a common environment.
This is done either manually- or with the script provided here (shown below):
echo "[+] Installing Xfce, this will take a while"
apt-get dist-upgrade -y
apt-get install -y kali-desktop-xfce xrdp
echo "[+] Configuring XRDP to listen to port 3390 (but not starting the service)..."
sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini
Do the following to use the script:
kali@kali:~$ wget https://gitlab.com/kalilinux/build-scripts/kali-wsl-chroot/-/raw/master/xfce4.sh
kali@kali:~$ chmod +x xfce4.sh
kali@kali:~$ sudo ./xfce4.sh
Remote desktop connection Kali Linux manual setup provides more control over remote access to Kali Linux machines configuration settings, but requires a bit more time to do. For those using WSL, once XFCE and RDP are set up, users must start the service and connect.
kali@kali:~$ sudo systemctl enable xrdp --now
For WSL-users, dbus-x11 must be installed next to allow Xrdp and XFCE to connect:/
kali@kali:~$ sudo apt install -y dbus-x11
Run the following to start the service:
kali@kali:~$ sudo /etc/init.d/xrdp start
Remote desktop to Kali users then connect with the RDP client related to the particular system (users should note the port that is in use, also.) If the script above was used, the port would be 3390.
Kali Linux tools to remote access with IP note: In the case of WSL, the IP is 127.0.0.1:3390 for users wishing to connect to/from Windows machines.
Remote Desktop (GUI) access to Kali
Once you’ve selected the desired Kali Linux tools to access remote computers, open a terminal window and run the following Commands in Kali OS. The below will describe how to set up GUI access for remote machines.
Note: If you already have a user or just want to use root, then skip the user creation path
adduser tdh– Add a user for remote login
- • Set a password and other info
u sermod -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
Users can enable XRDP to start automatically when the machine turns on by entering the following commands:
systemctl enable xrdp
systemctl enable xrdp-sesman
How to set up RDP for Windows remote machines
Step 1: Open Remote Desktop Connection on the Windows machine
Step 2: Enter the Kali machine’s IP and hit connect
- Step 3: Exit the session on Xorg and click “OK” after entering the required credentials.
Note: If users encounter a blank screen: reboot the machine but don’t log in. Log in with a remote desktop only- this is due to multiple sessions (one remote and one local.)
After solving this “second session” remote Linux issue, permit as many sessions as desired by doing as follows: Edit
“/etc/xrdp/startwm.sh”, and then add the aforementioned line before the lines that test and execute Xsession.
While the $HOME/.profile isn’t part of the solution, “$HOME/.profile” should always run prior to starting a session.
- • unset DBUS_SESSION_BUS_ADDRESS
- • unset XDG_RUNTIME_DIR
- • . $HOME/.profile
Terminal Access using SSH
From the Kali operating system, 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
Use putty on Windows to connect to Kali via SSH
Users can auto start with the command: “systemctl enable ssh” .
This concludes the guide on enabling remote desktop and SSH access to Kali.
As a final note: don’t forget to restart and upgrade the machine, whether you’re running a Kali, Ubuntu, or Windows OS.