Results 1 to 3 of 3

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

  1. #1
    Junior Member
    Join Date
    Jan 2017
    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

  3. #3
    Junior Member
    Join Date
    Oct 2016
    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.

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
  •