neutrinolabs / xrdp

xrdp: an open source RDP server
http://www.xrdp.org/
Apache License 2.0
5.72k stars 1.73k forks source link

Problems connecting to xrdp server after host is renamed and rebooted #3021

Closed JoeSalmeri closed 2 months ago

JoeSalmeri commented 7 months ago

xrdp version

0.9.23.1

Detailed xrdp version, build options

xrdp 0.9.23.1
  A Remote Desktop Protocol Server.
  Copyright (C) 2004-2020 Jay Sorg, Neutrino Labs, and all contributors.
  See https://github.com/neutrinolabs/xrdp for more information.

  Configure options:
      --host=x86_64-suse-linux
      --build=x86_64-suse-linux
      --program-prefix=
      --disable-dependency-tracking
      --prefix=/usr
      --exec-prefix=/usr
      --bindir=/usr/bin
      --sbindir=/usr/sbin
      --sysconfdir=/etc
      --datadir=/usr/share
      --includedir=/usr/include
      --libdir=/usr/lib64
      --libexecdir=/usr/libexec
      --localstatedir=/var
      --sharedstatedir=/var/lib
      --mandir=/usr/share/man
      --infodir=/usr/share/info
      --enable-ipv6
      --enable-painter
      --with-systemdsystemunitdir=/usr/lib/systemd/system
      --with-pamconfdir=/usr/lib/pam.d
      --enable-vsock
      --enable-fuse
      build_alias=x86_64-suse-linux
      host_alias=x86_64-suse-linux
      CFLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g
      LDFLAGS=-flto=auto
      PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig

  Compiled with OpenSSL 3.1.4 24 Oct 2023

Operating system & version

openSUSE Tumbleweed 20240319

Installation method

dnf / apt / zypper / pkg / etc

Which backend do you use?

Xvnc

What desktop environment do you use?

KDE Plasma

Environment xrdp running on

Issue occurs with xrdp on a physical machine AND also reproduced in a VM

What's your client?

Testing using krdc and xfreerdp

Area(s) with issue?

Session manager (sesman)

Steps to reproduce

I have been using xrdp for YEARS and it has worked pretty much flawlessly.

Recently I renamed the server which xrdp is running on.

After the server rename it was rebooted and DNS and the routers were all updated to reflect the new name.

Remote machines can ping and ssh the new name, it is not a dns issue because everything resolves to the new name and nothing has any connectivity issues except for when I connect to the xrdp server using the new name.

I have rebooted all machines involved as well as the routers.

When I connect using krdc using the NEW name it just displays a blue screen and never displays the desktop but sometimes I hear it play the login sound.

If I try to use the OLD name with krdc then I get server not found.

Originally I thought this was a xrdp issue BUT I just found that if I use xfreerdp to connect to the NEW server name then it works perfectly.

On Windows machines if you attempt to connect using the NEW name then you get a certificate warning ( because the name changed ) and then after accepting it works fine.

I believe that xfreerdp works because it may have been built to default to an option to ignore certificate issues.

I have removed and reinstalled xrdp on the server in question and the problem persists.

I have also recreated the exact same issue if I have xrdp running in a VM and then I change the vm's host name ( and reboot and update DNS to reflect the new name ).

I believe that the issue is caused by a cached certificate on the clients that has the OLD hostname but I have not been able to find out how to delete it.

This reminds of of similar issue that occurs with ssh and known_hosts which occurs when a rename like this occurs.

Changing the xrdp server name back to the OLD hostname, rebooting and updating DNS/routers etc and then rdp works again.

Because that works and because everything else works when you rename except for krdc leads me to believe that some cached certificate is the cause but it doesn't prompt like Windows does to allow me to accept the new certificate.

✔️ Expected Behavior

RDP to connect and work using the NEW hostname

❌ Actual Behavior

See steps for full details but basically just get a blue screen and session is never displayed

Anything else?

See details in Steps but short answer is the blue screen