Results 1 to 4 of 4

Thread: How to set up xrdp on the AWS Kali image

  1. #1
    Junior Member
    Join Date
    Jan 2017

    How to set up xrdp on the AWS Kali image

    This took me a long time to figure out and I used a combination of a handful of online tutorials and a lot of trial and error. I figured others would like a concise guide for this problem. I have not tested on a local Kali image, but I imagine much of the config would work.

    OS: Kali Linux 2016.2
    AMI: Updated 19 Oct 2016

    Bash commands:

    # Upgrade OS
    sudo apt-get update -y && apt-get upgrade  -y
    sudo apt-get dist-upgrade -y
    # Get required packages
    sudo apt-get install xrdp lxde-core lxde tigervnc-standalone-server -y
    # Set the session manager
    sudo update-alternatives --config x-session-manager
    # choose xfce4-session

    # New sudo user for password-based connection (ec2-user uses an SSH key)
    sudo useradd -m kali
    sudo passwd kali
    sudo usermod -a -G sudo kali
    sudo chsh -s /bin/bash kali
    # edit xrdp.ini - reducing colour depth reduces bandwidth and can resolve black screen issues
    sudo nano /etc/xrdp/xrdp.ini
    # changed username and password to the kali user

    # Allow more than root to access the system
    sudo nano /etc/X11/Xwrapper.config

    # start services
    sudo service xrdp start
    sudo service xrdp-sesman start
    # configure services to auto-start on boot
    sudo update-rc.d xrdp enable
    sudo systemctl enable xrdp-sesman.service

    # Test: services should be green and active
    sudo service xrdp status
    sudo service xrdp-sesman status
    # Test: use an rdp client
    Connecting to the Kali IP with an RDP client and the new user's password should present you with the Kali desktop.

    # Test: launch Wireshark
    Launch Wireshark to see if it launches at all. This was on test that failed when I tried to use VNC or other RDP options and configs.

  2. #2

  3. #3
    Junior Member
    Join Date
    Oct 2016
    Try Harder.
    I realized that the reason xrdp doesn't work was because the folder /var/run/xrdp isn't made when the xrdp service is started.
    Before starting services
    mkdir /var/run/xrdp
    then after you start services, we need to be sure that folder is made when the computer boots. /var/run is wiped on reboot so:
    edit /etc/rc.local with a text editor. add
    if [ ! -d /var/run/xrdp ]; then
       mkdir /var/run/xrdp/
       chown root:root /var/run/xrdp
    Also, you don't need to switch from gnome to lxde if you start with the LXDE kali version.

    Thanks to the guys in ##linux on freenode for making fun of me enough to go research this.

  4. #4
    its showing login failed for display 0 after i login via sesman on rdp client.

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