Running Ubuntu 16.04 in
host, I have the following setup:
user1, who performed a GUI login in
user2, who is a
sudoerand is logged in only through a text
I would like
user2 to run an X application, for example
xclock, on the
user1 display. From
user1 perspective, this must be the same as when
user1 itself runs
The owner of the process
xclock should be
user2, because this is the user who launched it, but however this is not important.
Edit: I can use
sudo, but I can not use
user1 password, which is unknown to me.
How to accomplish this?
I read this answer and this answer, but they contain no direct examples about this. I also read about
MIT-MAGIC-COOKIE-1 and I obtained the list of cookies with
xauth list, but wasn't able to use them.
I tried, from the prompt in the
ssh connection (so, as
$ env DISPLAY=:0 XAUTHORITY=/home/user1/.Xauthority xclock
but this causes the prompt to never return. Note that, being a
user2 is potentially able to read/copy/write the file
user1 home directory. The above commands, however, don't work even when
user1 are the same.