Skip to content

Instantly share code, notes, and snippets.

@Koasing
Last active March 31, 2018 04:33
Show Gist options
  • Save Koasing/da41a65b66a6c493ee8d86e7539d1224 to your computer and use it in GitHub Desktop.
Save Koasing/da41a65b66a6c493ee8d86e7539d1224 to your computer and use it in GitHub Desktop.
Setup xrdp on Lubuntu 17.10

Setup xrdp on Lubuntu 17.10

I recommend Lubuntu to use with xrdp, because Ubuntu's default GUI, Unity, does not work with xrdp. Lubuntu uses LXDE which is compatable with xrdp.

Install xrdp

# apt-get install xrdp
blahblah

Open Firewall

By default, RDP uses 3389 port.

# ufw allow from any to any port 3389
Rule added

Allow Xwrapper

Ref: http://c-nergy.be/blog/?p=10887

Since unknonw, Xorg disallow execution from remote session, which blocks xrdp to login.

Open /bin/X11/Xwrapper.config then change allowed_user from console to anybody.

Create certificate

Common Name is important. Use your server's URL or hostname.

# cd /bin/xrdp
# rm cert.pem key.pem
# openssl req -x509 -newkey rsa:2048 -nodes -keyout key.pem -out cert.pem -days 365
Generating a 2048 bit RSA private key
...
...
writing new private key to 'key.pem'
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:.
State or Province Name (full name) [Some-State]:.
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:.
Organizational Unit Name (eg, section) []:
Common Name (e.g. server FQDN or YOUR name) []:server-name
Email Address []:
# chown xrdp:root *.pem
# chmod 644 cert.pem
# chmod 600 key.pem
# service xrdp restart

Connect using RDP

On Windows PC, open Remote Desktop Client (start - run - mstsc) then input your Linux PC's IP address.

It should work with some warning messages (related to certificates).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment