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.
When you perform a Kali Linux installation, SSH, XRDP and VNC are installed by default. The services are not enabled and will need to be started before you can remote desktop to the Kali Linux system from another machine.
How To Establish Remote Access To Kali Linux – native solution
The following steps are necessary to implement a Kali Linux remote desktop.
- Obtain the IP address of the Kali Linux system.
- Choose the protocol you will use to set up a Kali remote desktop connection. (SSH, XRDP, or VNC).
- Configure and use the selected tool on your Kali Linux system.
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.
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.
The setup for RDP on Kali Linux depends on what system Kali is running on. An example is Docker which requires a launch command like:
docker run -p 3390:3390 --expose=3390 --tty --interactive KaliLinux/Kali-rolling /bin/bash
Performing activities such as resuming an exited container is possible when implementing a Kali Linux RDP connection with Docker.
If the Kali RDP connectivity will involve AWS cloud instances, the machine needs to be configured to allow the remote computer to access the necessary ports.
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.
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
VNC for Kali Remote Desktop
VNC is an alternative remote desktop solution to RDP for Kali Linux. The protocol is installed by default with Kali Linux but requires a password to be set before using the tool.
A major difference between VNC and XRDP is that with XRDP a new session is established when you connect remotely and your login credentials are required. VNC allows you to take control of the current session as long as you can supply a VNC password.
VNC is a favorite tool of technical support teams. They use it to remote desktop to a Kali system, identify the issue, and fix it while the user watches the screen activity.
vncserver command to create the VNC password.
When you first start VNC, you need to provide the password. You will be supplied with the session URL for access. If you run into issues, look at this post from SuperUser.
You can enable SSH and start VNC from there if it does not start automatically. Once VNC is enabled and you have the URL, you can connect to it to establish a remote desktop to the Kali Linux system.
Both XRDP and VNC give you full access to the system’s interface. A difference with XRDP is that with a VNC connection, screen activity will be visible on the remote computer. Users can monitor activity and interact using the keyboard or mouse. XRDP creates a new session that is not visible to users who are physically watching the remote machine.
Always close the VNC session when you are finished.
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.