Results 1 to 5 of 5

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

  1. #1
    Join Date
    2017-Jan
    Posts
    1

    How to set up xrdp on the AWS Kali image

    https://gist.github.com/Erreinion/f2...d9874dc667e998

    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
    Code:
    sudo apt-get update -y && apt-get upgrade  -y
    sudo apt-get dist-upgrade -y
    # Get required packages
    Code:
    sudo apt-get install xrdp lxde-core lxde tigervnc-standalone-server -y
    # Set the session manager
    Code:
    sudo update-alternatives --config x-session-manager
    # choose xfce4-session

    # New sudo user for password-based connection (ec2-user uses an SSH key)
    Code:
    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
    Code:
    sudo nano /etc/xrdp/xrdp.ini
    autorun=sesman-any
    max_bpp=16
    [sesman-any]
    ip=127.0.0.1
    # changed username and password to the kali user

    # Allow more than root to access the system
    Code:
    sudo nano /etc/X11/Xwrapper.config
    allowed_users=anybody

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

    Tests:
    # Test: services should be green and active
    Code:
    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
    Join Date
    2016-Oct
    Posts
    3

  3. #3
    Join Date
    2016-Oct
    Posts
    3
    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
    Code:
    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
    Code:
    if [ ! -d /var/run/xrdp ]; then
       mkdir /var/run/xrdp/
       chown root:root /var/run/xrdp
    fi
    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.

  5. #5
    Join Date
    2018-Mar
    Posts
    1
    make sure you run /usr/sbin/xrdp-sesman before you login

Similar Threads

  1. Kali AWS AMI is painfully slow using XRDP
    By surfd4wg in forum Installing Archive
    Replies: 1
    Last Post: 2021-06-14, 22:30
  2. Error on Kali Linux WSL 2 XRDP
    By robisonweb in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2021-04-15, 20:48
  3. getting XRDP to work on Kali (Raspberry Pi)
    By WEP in forum General Archive
    Replies: 1
    Last Post: 2015-10-29, 08:32
  4. Issues with using XRDP - Kali Linux
    By WEP in forum Installing Archive
    Replies: 1
    Last Post: 2015-03-13, 15:02

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
  •