Enable Remote Desktop on Linux Mint 20

Created on
September 18, 2020
Achieved
September 16, 2020
Isought the ability to access my Linux Desktop remotely because I wanted to be able to make improvements and progress with both Linux and Windows 10. I usually divided my time between the two, alternating between OSes every two weeks. In order for me to do this on my laptop, I would have to turn off secure boot and press F9 when my PC started so I could manually select the USB drive it was installed on. That was becoming impractical as I wanted to expand on my CIS 225-related knowledge.
To pull this off, the following conditions must be met:
• you must have xrdp installed.
• the firewall rules on Linux must allow communication through port 3389 via TCP.
• you must have cntlm installed.
• you must know the private IP address of the computer you are communicating WITH, and the one you wish to communicate TO.
• both PCs must be on the same network.
Open your terminal. This usually requires you to press Ctrl + Alt + T. To open a new terminal tab, type Ctrl + Shift + T. To close a terminal tab, type Ctrl + Shift + W. When you see sudo prior to a command, you must be ready to type your account password after pressing enter.

Type the following into your terminal, one line at a time:
sudo apt-get install xrdp -y
sudo systemctl enable xrdp
The first line will install XRDP from its repository, and the second line will enable it. The use of the -y flag automatically says yes to the installation where it would otherwise ask the user. Please restart your Linux installation now. Log back in, and open another terminal. Once it opens, type the following:
sudo ufw enable
sudo ufw allow 3389/tcp
The first line activates the Linux Unified Firewall. The second line tells it to allow port 3389 over TCP to pass through the firewall. This is necessary for Remote Desktop to work. The next step will require you to install CNTLM, if it isn't on your Linux installation already. Please open up another terminal, and type the following, one line at a time:
sudo apt-get install cntlm -y
The above command installs CNTLM to the Linux PC. The use of the -y flag automatically says yes to the installation where it would otherwise ask the user. You will need to generate a hashed version of the password to the Windows account you wish to connect with. Enter the following command into a terminal:
sudo cntlm -H
You will then be asked to type a password for CNTLM configuration. Type slowly so that you avoid typos.
Several hashed passwords should result. Be sure to copy these lines into the configuration file located in /etc/cntlm.conf. This file must be opened in an elevated environment. To do this, type the following into the terminal:
sudo xed /etc/cntlm.conf
This tells Linux Mint to open cntlm.conf in the default text editor for Cinnamon desktop. You'll see a red bar indicating that you're editing a file with elevated privileges. Copy and paste the several hashed passwords over the example text halfway through the document.
Remember when I said you'd need to know what your LOCAL IP addresses are? It's time. If you have a terminal open, type ifconfig and press enter. The Windows equivalent command is ipconfig. If you are using a VPN, you must include the private IP address for the VPN, otherwise the connection will fail.
Under the proxy and listen header, include the PRIVATE IP addresses of the PCs that will be communicating. At the top of the document, replace the text to the right of username and workgroup with the names of your user account and workgroup. If you do not use a non-standard workgroup name, you can just type 'WORKGROUP'.
Finally, you'll need to export this to your proxy settings. Enter the following command in your terminal:
export http-proxy=http://(local IP of Linux PC):3389/
Restart your Linux PC one more time. If you are using a VPN to connect, both PCs must be on the same VPN network. Log in to your Linux Mint account, and enable the VPN. Then log out. You cannot log in to a user account that's already logged on locally.
- 🎙 © 2020 Mass Transit Honchkrow