When attempting to connect to your Ubuntu server via Windows Remote Desktop Protocol (RDP), encountering the following error indicates authentication issues despite entering correct credentials:
connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to sesman
xrdp_mm_process_login_response: login failed
Before diving deep, perform these basic verifications:
- Ensure the xrdp service is running:
sudo systemctl status xrdp - Verify your Ubuntu user has a valid password (not empty)
- Check firewall rules:
sudo ufw allow 3389/tcp
Edit the xrdp configuration file:
sudo nano /etc/xrdp/xrdp.ini
Add or modify these lines under [globals]:
security_layer=negotiate
crypt_level=high
max_bpp=24
The sesman configuration often needs adjustments:
sudo nano /etc/xrdp/sesman.ini
Ensure these values are set:
[Security]
AllowRootLogin=false
MaxLoginRetry=4
TerminalServerUsers=tsusers
TerminalServerAdmins=tsadmins
Sometimes creating a specific user for RDP helps isolate issues:
sudo adduser xrdpuser
sudo usermod -aG sudo xrdpuser
sudo usermod -aG tsusers xrdpuser
If password authentication continues to fail, consider using SSH keys:
sudo apt-get install xorgxrdp
sudo systemctl restart xrdp
Then configure XRDP to use PAM authentication:
sudo nano /etc/pam.d/xrdp-sesman
Add these lines:
@include common-auth
@include common-account
@include common-session
@include common-password
Enable verbose logging to pinpoint issues:
sudo nano /etc/xrdp/xrdp.ini
Set log level to debug:
LogLevel=DEBUG
Then examine logs in real-time:
tail -f /var/log/xrdp.log /var/log/xrdp-sesman.log
When standard xrdp fails, X11rdp often works:
sudo apt-get install xserver-xorg-core xserver-xorg-input-all
sudo apt-get install x11rdp
sudo service xrdp restart
Many developers encounter this frustrating error when trying to establish a Remote Desktop connection to their Ubuntu servers:
connecting to sesman ip 127.0.0.1 port 3350
sesman connect ok
sending login info to sesman
xrdp_mm_process_login_response: login failed
After troubleshooting numerous similar cases, I've found these common culprits:
- Incorrect session type configuration in /etc/xrdp/xrdp.ini
- Missing or misconfigured .xsession files
- Permissions issues in /home directories
- Firewall blocking the sesman port (3350)
Here's the step-by-step solution that has worked across Ubuntu 18.04, 20.04, and 22.04:
# First, ensure proper packages are installed
sudo apt update
sudo apt install xrdp xorgxrdp
# Configure the session environment
echo "gnome-session" > ~/.xsession
chmod +x ~/.xsession
# Restart the services
sudo systemctl restart xrdp
sudo systemctl restart xrdp-sesman
# Verify port listening
sudo netstat -tulnp | grep xrdp
For more complex setups, modify /etc/xrdp/xrdp.ini:
[globals]
bitmap_cache=yes
bitmap_compression=yes
port=3389
crypt_level=high
[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
If the issue persists, check these logs:
# Xrdp main log
tail -f /var/log/xrdp.log
# Session manager log
tail -f /var/log/xrdp-sesman.log
# Authentication logs
tail -f /var/log/auth.log
For environments where xrdp continues to be problematic, consider these alternatives:
# Option 1: X2Go (better for remote GUI)
sudo apt install software-properties-common
sudo add-apt-repository ppa:x2go/stable
sudo apt update
sudo apt install x2goserver x2goserver-xsession
# Option 2: NoMachine (proprietary but performant)
wget https://download.nomachine.com/download/8.4/Linux/nomachine_8.4.1_1_amd64.deb
sudo dpkg -i nomachine_8.4.1_1_amd64.deb