On 27/07/2024 23:06, Greg Wooledge wrote:
Yes, but the other ways are *far* more complicated, especially when
neither user1 nor user2 is root. The issue is that in order to
authenticate yourself to the X server, you present a token, known as
a "magic cookie".
in some cases
xhost +si:localuser:greg
may help to give access to the X11 socket to all processes running by
another user.
It may be more tricky to arrange permissions for GPU, audio devices, and
other hardware. By default udev and systemd-logind "uaccess" feature
dynamically grants access to currently active user through ACLs. Adding
another user to a number of groups may give it *permanent* access to
that devices.
The actual question is if applications running by different users should
appear on the same X11 display or switching between user sessions (using
Ctrl+Alt+F*, desktop environment menu, CLI commands) is acceptable or
even desired.
In the case of the same display another user may sniff selection
(clipboard), key press events.