Installing AnyDesk on Ubuntu Server 24.04 for Session-Based RDP Connections

Abstract: Resolve the inability to establish simultaneous multi-user RDP sessions on Ubuntu Server 24.04 by installing and configuring xrdp as a native alternative to AnyDesk.

Created: 2026-10-18 by

AnyDesk does not support native RDP or session-based multi-user connections on Ubuntu Server. To achieve simultaneous remote desktop access for multiple users, you must use xrdp, an open-source RDP server that integrates with the existing display manager. This approach provides standard Remote Desktop Protocol compatibility and true concurrent sessions.

Why AnyDesk Is Not Suitable for Multi-User RDP

The core misunderstanding in many initial requests is conflating proprietary remote access tools with open-standard protocols. AnyDesk is designed primarily for individual technician-to-machine support or single-user remote work. It lacks a command-line interface flag for passwordless authentication, meaning manual interaction is always required for the first connection. Furthermore, it does not implement the Remote Desktop Protocol (RDP) natively. Instead, it uses its own proprietary protocol over port 6568. Attempting to force AnyDesk into a multi-user RDP scenario will fail because it does not manage Linux display sessions in the way an RDP server does. When you connect via AnyDesk, you are typically sharing or taking control of the current physical console session or a specific virtual session managed by the host software. It does not spawn independent X11 or Wayland sessions for each incoming client. Consequently, if two users attempt to connect simultaneously, they will either fight for control of the same screen or one will be rejected entirely. There is no max_sessions configuration file for AnyDesk because the architecture simply does not support parallel user isolation. For organizations requiring multiple users to log in and work simultaneously on a headless Ubuntu Server, the industry standard solution is xrdp. This software acts as a bridge between the Windows RDP client and the Linux graphical environment. It allows each user to establish their own distinct session, complete with their own desktop environment, processes, and login state. This directly addresses the requirement for session-based connectivity that AnyDesk cannot provide.

Installing and Configuring xrdp

To set up a robust multi-user remote desktop environment, you need to install the xrdp package along with a compatible window manager. Ubuntu Server installations often lack a default graphical interface, so you may also need to install a lightweight desktop environment like XFCE or GNOME, depending on your resource constraints. For this guide, we assume you have already installed a desktop environment such as xubuntu-desktop or xfce4. First, update your package lists to ensure you are installing the latest stable versions. Run the following commands in your terminal:
sudo apt update
sudo apt install xrdp xfce4 xfce4-goodies
The xfce4-goodies package includes additional plugins and enhancements that improve the remote desktop experience, such as better clipboard handling and session management. Once the installation completes, you must enable and start the xrdp service. Unlike some services that start automatically upon installation, xrdp often requires explicit activation.
sudo systemctl enable xrdp
sudo systemctl start xrdp
You should verify that the service is running correctly by checking its status:
sudo systemctl status xrdp
If the service is active and running, you can proceed to configure the firewall. By default, Ubuntu Server blocks incoming connections unless explicitly allowed. You need to open port 3389, which is the standard port for RDP traffic. Use UFW (Uncomplicated Firewall) to permit this traffic:
sudo ufw allow from any to any port 3389 proto tcp
This step is critical. Without opening port 3389, your RDP clients will time out when trying to connect. If you are using a different firewall solution, ensure that inbound TCP traffic on port 3389 is permitted. For more information on troubleshooting network connectivity issues on Ubuntu Server, see our guide on Ubuntu Server 22.04 Unreachable via SSH After Time, which covers common firewall and networking pitfalls.

Configuring Security and Permissions

Security is paramount when exposing a remote desktop service to the internet. By default, xrdp stores SSL certificates in a directory that may not have the correct permissions, leading to connection errors. You need to fix these permissions to ensure smooth operation.
sudo chmod 600 /etc/xrdp/rsakeys.ini
sudo chmod 755 /var/run/xrdp/sockdir
Additionally, you should restrict access to trusted IP addresses if possible. While UFW allows broad rules, you can tighten security by allowing only specific subnets. However, for most small to medium deployments, relying on strong passwords and potentially implementing fail2ban is sufficient. Fail2ban can monitor xrdp logs and ban IPs that attempt repeated failed logins. Install fail2ban using:
sudo apt install fail2ban
Create a jail configuration for xrdp at /etc/fail2ban/jail.local to protect against brute-force attacks. This adds a layer of defense that proprietary tools like AnyDesk do not offer out-of-the-box for server environments.

Connecting Multiple Users Simultaneously

Once configured, any user with valid system credentials can connect using a standard RDP client. On Windows, use "Remote Desktop Connection." On macOS, you can use Microsoft Remote Desktop or FreeRDP. On Linux, various clients like Remmina are available. When a user connects, xrdp creates a new Xsession. This means User A sees their own desktop, and User B sees theirs. They do not interfere with each other. This is the fundamental difference between AnyDesk's session sharing model and xrdp's session spawning model. If you encounter issues where users cannot log in, check the /var/log/xrdp-sesman.log file for errors related to session creation. It is also important to note that headless servers may require a dummy graphics driver if no physical monitor is attached, as some desktop environments refuse to start without detecting a display. Installing a dummy HDMI dongle or configuring xorg.conf.d to emulate a display can resolve black screen issues during remote login. For monitoring headless setups, refer to Monitoring Headless Ubuntu 24.04 Server with Installed Xubuntu-core for best practices on maintaining visibility without physical hardware.

Frequently Asked Questions

Can I use AnyDesk for multiple users?

No, AnyDesk is designed for single-user remote control or support scenarios. It does not support concurrent sessions for different users working independently. Attempting to use it for multi-user access will result in conflicts over the shared desktop session.

Does xrdp support Wayland?

xrdp has limited support for Wayland. It works best with X11-based desktop environments like XFCE, MATE, or LXDE. If you are using GNOME or KDE Plasma, which default to Wayland on newer Ubuntu versions, you may need to switch to X11 mode in the login screen or adjust xrdp configurations to handle Wayland sockets, which can be unstable.

Is port 3389 secure enough for production?

Port 3389 is the standard for RDP, but it is a frequent target for brute-force attacks. It is essential to pair xrdp with fail2ban, use strong passwords, and ideally restrict access via VPN or firewall rules to known IP ranges. Never expose port 3389 directly to the public internet without additional security layers.

How do I troubleshoot black screens on login?

Black screens usually indicate that the display manager failed to start a session. Check /var/log/xrdp-sesman.log for errors. Common fixes include ensuring the correct desktop environment is installed, fixing permissions on /tmp/.X11-unix, or adding a dummy graphics driver configuration to satisfy the display requirements of the session.

Can I transfer files between my local machine and the server?

Yes, xrdp supports drive redirection. In your RDP client settings, enable "Drives" or "Local Resources" to map your local hard drives to the remote session. This allows you to drag and drop files between your local computer and the Ubuntu Server desktop environment seamlessly.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More