Results 1 to 11 of 11

Thread: Enabling Remote Desktop and SSH access to Kali

  1. #1
    Join Date
    2019-Mar
    Location
    Western Canada
    Posts
    11

    Enabling Remote Desktop and SSH access to Kali

    There are multiple ways to access a Kali system remotely. Traditionally, remote access to a kali system would be performed with a text only console using SSH. There is also a method of accessing kali and getting a full desktop environment. This can be particularly useful in cases where the Kali system is installed on a separate physical system and not in a virtual machine.

    Remote Desktop (GUI) access
    In Kali, open a terminal window and run the following commands. Substitute your username in place of ?mike? in the examples below:


    # adduser mike Add a user for remote login. Set a password and other info.
    # usermod -aG sudo mike 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


    1. Open your remote desktop client in Windows. Enter the address of your Kali system and connect. You will likely get prompted that the identity of the computer cannot be verified and asked if you wish to connect anyway. Say yes, and optionally set the checkbox to not be prompted again. When you get to the Kali login GUI, keep ?Xorg? as the session and use the username and password created earlier. Once logged in you will be able to use and interact with the Kali desktop.

    Assuming everything has worked to this point, you can enable XRDP to start automatically on subsequent boots with the following commands:
    # systemctl enable xrdp
    # systemctl enable xrdp-sesman

    Terminal (text-only) Access using SSH
    In Kali, open a terminal window and run the following commands:


    # adduser mike Add a user for remote login. Set a password and other info.
    # usermod -aG sudo mike Get an updated list of installable packages
    # systemctl start ssh Start the base ssh server

    On your PC, download and install Putty. Open putty. Enter the name or IP address of your Kali system in the Host Name field. Ensure the Port is set to 22 and the Connection Type field is ?SSH?. Click open.
    You may be prompted that the SSH keys are not in your system and asked if you wish to proceed anyway. Click yes. Login with your username and password that you previously setup. Remember these are case-sensitive.
    Last edited by yaksmen; 2020-02-10 at 05:25. Reason: Fixed a few typos

  2. #2
    Join Date
    2020-Jan
    Posts
    1
    For anyone who gets an error when running the above command :

    # apt-get install rdpInstall the RDP server

    This should actually be :

    # apt-get install xrdpInstall the RDP server

    Thanks @yaksmen this got me up and running with RDP nice and quick

  3. #3
    Join Date
    2020-Jan
    Posts
    1
    Great tutorial! Looks like it should be very useful.

    I do want to note, in the "Terminal" section you have:

    # systemctl start ssh Start the base XRDP server

    ... which is starting the SSH daemon, not the XRDP server so that comment may need to be changed!

  4. #4
    Join Date
    2019-Mar
    Location
    Western Canada
    Posts
    11
    Thanks very much for your comment @marl_scot! I have fixed it in the entry above as well.

  5. #5
    Join Date
    2019-Mar
    Location
    Western Canada
    Posts
    11
    Thanks for the comment @iditabad! Fixed in the original post :-)

  6. #6
    Join Date
    2019-Aug
    Posts
    2
    Hi

    Is this working on a 2020 Kali installation becuase a clean install of 20201b works up until clicking the `OK` button in XRDP and then screen goes black and the rdp session is terminated.

    Have made sure the colour depth is 16bit - any thoughts ?

    Regards

  7. #7
    Join Date
    2020-May
    Posts
    1
    Hi, I followed the steps and was able to RDP with root but not the user I use. myuser has sudo privileges. What I am missing? Thanks

  8. #8
    Join Date
    2020-Aug
    Posts
    3
    Quote Originally Posted by bun_baker View Post
    Hi

    Is this working on a 2020 Kali installation becuase a clean install of 20201b works up until clicking the `OK` button in XRDP and then screen goes black and the rdp session is terminated.

    Have made sure the colour depth is 16bit - any thoughts ?

    Regards
    Hello,
    I have the same issue in our Org. None of my colleagues is able to connect via xrdp to KALI 2020 v.1/2. We could get there using KALI 2019 and older versions, but after the upgrade to KALI 2020 it's no longer possible.
    We found out that the problem might be related to authentication to Gnome GUI, actually the error messages we managed to found are related to gnome-keyring-daemon. And also something with /etc/pam.d/common-auth.

    In /var/log/auth :
    Jul 19 04:37:52 la gnome-keyring-daemon[1510]: couldn't access control socket: /run/user/1001/keyring/control: No such file or directory


    Can onyone from the KALI team look at it, pls?
    Thx

  9. #9
    Join Date
    2020-Aug
    Posts
    1
    I was able to get Remote Desktop working with Kali 2020.3


    sudo adduser <new username> # Not really required, see further down.
    sudo apt-get update
    sudo apt-get install xrdp
    sudo systemctl start xrdp
    sudo systemctl start xrdp-sesman



    I had to ensure the user logging in via RDP was NOT already logged into the console.

    Then using Windows mstsc.exe, keep the session as Xorg, and I was able to log in fine.

    Once tested:
    systemctl enable xrdp
    systemctl enable xrdp-sesman


    Thanks OP!

  10. #10
    Join Date
    2020-Dec
    Posts
    1
    It's working fine with Kali 2020.4 with the same steps

    make sure you log out from kali gui and retry to connect using rdp from wherever you want, it would work

  11. #11
    Join Date
    2021-Jan
    Posts
    4
    I have a problem with the black screen after authentication, or the RDP client will just quit. XRDP logs show a successful connection, then closed socket.
    I can log in with the built in Kali user, but all other users have an issue. I have the VM hosted on Virtualbox 6.1.10.
    I followed the following guide to set up RDP, removed packages, then installed them, same issue: https://www.kali.org/docs/general-us...-environments/
    I have created two users, both aren't able to connect. I have got it to connect a couple times, immediately after reloading the xrdp service or rebooting the VM.
    Oddly, the background is black which suggests to me it's something to do with DE

Similar Threads

  1. Replies: 3
    Last Post: 2020-06-03, 07:45
  2. Kali with XRDP and windows remote desktop client
    By jwouter in forum General Archive
    Replies: 0
    Last Post: 2018-12-05, 10:13
  3. Raspberry Pi 3 - Kali Linux - Remote Access over 3G
    By markojic in forum ARM Archive
    Replies: 3
    Last Post: 2017-07-06, 15:27
  4. Remote access with SSH/TightVNC failed with new Kali 2.0
    By kali2 in forum TroubleShooting Archive
    Replies: 5
    Last Post: 2016-02-25, 21:35
  5. Replies: 0
    Last Post: 2015-10-09, 01:01

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •