-
Notifications
You must be signed in to change notification settings - Fork 197
Description
Describe the update
Reading through https://github.com/orgs/X11Libre/discussions/61 , it seems like some documentation on running X as a non-root user is needed.
@callmetango Perhaps you can find a good place for this info so it is visible.
The X server needs access to various resources, most notably the screen and input devices.
This is true for any display solution, be it Xorg, Xlibre, tinyX, wayland, or anything else that needs to draw to the screen.
For this, the X server needs to have sufficient permissions to access these resources.
What exactly these resources are depends on the setup.
It might, for example, need read/write access to /dev/dri/card0, /dev/input/mice and /dev/tty7.
The simplest way to give the X server access to all these is to make the X server suid root.
Another simple method is to change the group owning these files to something like xgroup, and making the X server sgid xgroup.
Another popular solution is to hide the permissions in another program that handles the privileged stuff for you, so the X server binary and user don't need any special permissions.
Of the top of my head, some programs that do this are (e)logind, seatd and consolekit(2).
There are just some ways of handling the permissions for the X server. There are probably others.
If someone wants, they could probably use libcap to give the X server the needed permissions.
Some solutions are simpler that others and may use more or fewer dependencies.
Whatever the user/sysadmin chooses, they must choose something.
This is by design. If one could run the privileged operations that the X server needs to run, without being given extra permissions, that would be, by definition, a privilege escalation bug.
Additional Information
No response
Extra fields
- I have checked the existing issues
- I have read the Contributing Guidelines
- I'd like to work on this issue