Skip to content

[Resubmit] Improve support for running xrdp without privileges#3602

Merged
matt335672 merged 2 commits intoneutrinolabs:develfrom
matt335672:priv_fixes
Sep 1, 2025
Merged

[Resubmit] Improve support for running xrdp without privileges#3602
matt335672 merged 2 commits intoneutrinolabs:develfrom
matt335672:priv_fixes

Conversation

@matt335672
Copy link
Member

@matt335672 matt335672 commented Aug 29, 2025

fixes #3599

The xrdp daemon currently starts running as root for the following reasons:-

Once these startup actions have been completed, the daemon permanently drops root privileges.

A system administrator may wish to move the xrdp log file from its default location, for example, using the LogsDirectory setting documented in systemd.exec(5). If this is done, and no special listen options are required, it makes a lot of sense to start xrdp without any special privileges.

At the moment xrdp does not anticipate this might be done, and assumes it has been started as root. This PR simply checks for that occurrence and generates corresponding log messages.

xrdp/xrdp.c Outdated
LOG(LOG_LEVEL_ALWAYS,
"You are running xrdp as root. This is not safe.");
rv = 0;
"You are running xrdp as uid=%d gid=%d. This is not safe.",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, not directly related to the change, but "not safe" might sound too strong. It suggests being vulnerable or insecure (like not using TLS), whereas that’s not really the case. What about using "not recommended" instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed - that sound much better.

@matt335672 matt335672 merged commit a09b4c7 into neutrinolabs:devel Sep 1, 2025
14 checks passed
@matt335672
Copy link
Member Author

matt335672 commented Sep 1, 2025

Wiki also updated:

https://github.com/neutrinolabs/xrdp/wiki/Running-the-xrdp-process-as-non-root

@matt335672 matt335672 deleted the priv_fixes branch September 1, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xrdp daemon should not warn about running as root or try to do rootful things when systemd controls uid/gid

2 participants