Kali linux подключиться через rdp

Kali Linux Remote Access

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.

  1. Obtain the IP address of the Kali Linux system.
  2. Choose the protocol you will use to set up a Kali remote desktop connection. (SSH, XRDP, or VNC).
  3. 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.

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.

Читайте также:  Linux show file right

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):

#!/bin/sh
echo «[+] Installing Xfce, this will take a while»
apt-get update
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:~$
kali@kali:~$ chmod +x xfce4.sh
kali@kali:~$
kali@kali:~$ sudo ./xfce4.sh
kali@kali:~$

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
kali@kali:~$

For WSL-users, dbus-x11 must be installed next to allow Xrdp and XFCE to connect:/

kali@kali:~$ sudo apt install -y dbus-x11
kali@kali:~$

Run the following to start the service:

kali@kali:~$ sudo /etc/init.d/xrdp start
kali@kali:~$

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:

Читайте также:  Установка linux ssd hdd

How to set up RDP for Windows remote machines

  1. Step 1: Open Remote Desktop Connection on the Windows machine

remote desktop connection

  • Step 2: Enter the Kali machine’s IP and hit connect

    remote access to kali linux

  • 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.

    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.

    Use the 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

    remote desktop to kali

    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.

    Читайте также:  Первоначальная настройка linux debian

    Источник

    Kali linux подключиться через rdp

    Kali Linux is supported on many different devices and systems. On some of those systems, you may only get a bare-bones install and occasionally may not have direct access to a GUI such as with WSL or Docker. One simple way to get access to a GUI for Kali is by installing Xfce and setting up RDP. This can be done either manually or with the script provided here, and can be seen below:

    Before we can start the process of setting up Xfce and RDP, we must first acknowledge some differences with certain systems Kali is on. The first is Docker. To use this setup with Docker, we must supply a launch command like the following:

    docker run -p 3390:3390 —expose=3390 —tty —interactive kalilinux/kali-rolling /bin/bash

    For additional usage on Docker, such as how to resume an exited container, please read using Kali Docker images.

    For AWS, we must be sure to allow our IP to access the proper ports when we set up the machine.

    To use the script we do the following:

    [email protected]:/$ apt update && DEBIAN_FRONTEND=noninteractive apt install -y wget kali-linux-headless [email protected]:~$ wget https://gitlab.com/kalilinux/recipes/kali-scripts/-/raw/main/xfce4.sh [email protected]:~$ [email protected]:~$ chmod +x xfce4.sh [email protected]:~$ [email protected]:~$ sudo ./xfce4.sh [email protected]:~$ 

    Setting this up manually will provide more control over what configuration is done, but also will take a bit longer.

    If you are using WSL, dbus-x11 needs to be installed next for xrdp and xfce to connect:

    [email protected]:~$ sudo apt install -y dbus-x11 [email protected]:~$ 

    After you set up Xfce and RDP, you need to start the service:

    [email protected]:~$ sudo systemctl enable xrdp --now [email protected]:~$ # If on WSL or Docker [email protected]:~$ sudo /etc/init.d/xrdp start [email protected]:~$ 

    In the case of AWS, you will need to change the password to the default ‘kali’ account before connecting. This can be done with the following command:

    [email protected]:~$ echo kali:kali | sudo chpasswd [email protected]:~$ 

    If you are using Docker, you will need to create a new user. You can do this with adduser

    [email protected]:~$ adduser kali [. ] [email protected]:~$ 

    You can then connect with a RDP client to that system. Keep in mind the port that is being used. If you used the script, the port would be 3390. In the case of WSL and Docker, the IP would be 127.0.0.1:3390 that you would wish to connect to from your windows system (or the host systems IP from a separate computer). In the case of AWS, the IP would be the same as you use to connect via SSH.

    You may encounter the error Authentication Required to Create Managed Color Device when trying to connect. Do the following to fix this issue.

    Updated on: 2023-May-19
    Author: gamb1t

    Источник

    Оцените статью
    Adblock
    detector