Permission issue with latest xrdp package

I used XRDP for quite a while. It worked until May the 20s. Then after a few days, possibly with Nix package upgrading, it does not work anymore.

Using the same options, from Windows RDP client connecting to XRDP, after inputting username/password, it was black screen for some time, longer than usual, then told me it cannot connect to Xorg.

After enabled debug log for xrdp and xrdp-sesman, I saw Error connecting to X server [Permission denied]. Digging around, I got following information.

  • PS result showed that the program (xrdp-chansrv) between Xorg and XRDP was run as me, and XRDP was run as xrdp user.
  • The sockets opened by xrdp-chansrv were all owned by me.root, with permission 660.

Hence I stopped xrdp.service, and ran the exact command with me or root user, both worked.

Adding myself to xrdp group did not help.

I could not find related info if some config should be changed.


PS info:

root       91543   91543   91543  0.0  0.0  10128  3840 ?        Ss   15:00   0:00 /nix/store/ir1k6g953p730hfi6g8cdll3nfc5g20s-xrdp-0.10.3/bin/xrdp-sesman --nodaemon --config /nix/store/xpxhm37d7f3lkg3b7s2mpm8ix57qizs4-xrdp.conf/sesman.ini
root       91587   91543   91543  0.0  0.0  13764  6028 ?        S    15:00   0:00  \_ xrdp-sesexec -c /nix/store/xpxhm37d7f3lkg3b7s2mpm8ix57qizs4-xrdp.conf/sesman.ini
magiclo+   91591   91591   91543  0.0  0.0 109764 25352 ?        Sl   15:00   0:00      \_ /nix/store/pl2mapfil2bi7bdsypqyi6xa7b7asmjm-xorg-server-21.1.16/bin/Xorg :11 -auth .Xauthority -modulepath /nix/store/kbhc8rif9r3fi2ycni1plmdvgqxvgk81-xorgxrdp-0.10.4/lib/xorg/modules,/nix/store/pl2mapfil2bi7bdsypqyi6xa7b7asmj
magiclo+   91597   91591   91543  0.0  0.0   7824  3572 ?        S    15:00   0:00      \_ /bin/sh /nix/store/xpxhm37d7f3lkg3b7s2mpm8ix57qizs4-xrdp.conf/startwm.sh
magiclo+   91600   91591   91543  0.0  0.0  14464  8272 ?        S    15:00   0:00      |   \_ /run/current-system/sw/bin/xterm
magiclo+   91601   91601   91601  0.0  0.0  12756  7852 pts/2    Ss+  15:00   0:00      |       \_ zsh
magiclo+   91598   91591   91543  0.0  0.0  87940  5268 ?        Sl   15:00   0:00      \_ /nix/store/ir1k6g953p730hfi6g8cdll3nfc5g20s-xrdp-0.10.3/sbin/xrdp-chansrv
xrdp       91548   91548   91548  0.0  0.0  13148  7052 ?        Ss   15:00   0:00 /nix/store/ir1k6g953p730hfi6g8cdll3nfc5g20s-xrdp-0.10.3/bin/xrdp --nodaemon --port 3389 --config /nix/store/xpxhm37d7f3lkg3b7s2mpm8ix57qizs4-xrdp.conf/xrdp.ini

Sockers info:

$ ls -l /run/xrdp/1000
total 0
srw-rw---- 1 magicloud root 0 Jun  7 19:14 xrdp_chansrv_socket_10=
srw-rw---- 1 magicloud root 0 Jun  7 19:14 xrdp_disconnect_display_10=
srw-rw---- 1 magicloud root 0 Jun  7 19:14 xrdp_display_10=
srw-rw---- 1 magicloud root 0 Jun  7 19:14 xrdpapi_10=

Discuss in Xrdp repo: XRDP suddenly cannot connect to Xorg. What should I check? · neutrinolabs/xrdp · Discussion #3539 · GitHub

This seems to be the fix. I wonder why I got the new version of program, but not the conf change.

2f5a9ad9b4302 pkgs/applications/networking/remote/xrdp/default.nix (Boroczki, Lajos 2024-09-30 08:17:21 +0200 155) substituteInPlace $out/etc/xrdp/sesman.ini --replace '#SessionSockdirGroup=root' 'SessionSockdirGroup=xrdp'