4

I have basic desktop machine with two user accounts. I want to allow the second user ( no the one which started X ) to access xserver and run GUI programs.

I had this working using xhost from the login user but this no longer seems to work.

xhost +SI:localuser:fred

now if I do su - fred and try anything which requires X, I get an error to the effect that it cannot access the display.

$ xhost
xhost:  unable to open display ""

Please do not reply about how to use vnc, ssh or remote access. That is not the question.

Thanks for any help in how to do this, it is stopping me being able to work.

stacker
  • 41
  • 1
  • 4
  • 4
    Have you tried setting the `DISPLAY` variable? eg `DISPLAY=:0 xterm` – Stefan Apr 12 '17 at 20:58
  • 2
    Also look into `xauth`, MIT magic cookies and `ssh` X forwarding. – dirkt Apr 13 '17 at 07:35
  • dirk, you seem to have missed : "Please do not reply about how to use vnc, ssh or remote access. That is not the question. " – stacker Feb 06 '18 at 16:13
  • thanks Stephan, DISPLAY does the trick also. xhost seems to be the definitive answer, not sure who gave that -1 This all seems rather hit and miss. That's what I don't get. Sometimes I login to a new session or open a new shell ; sometimes it works other times not. :? – stacker Feb 06 '18 at 16:16
  • xhost +local:root – Dhiren Hamal Dec 11 '19 at 12:30

1 Answers1

4

you can try this:xhost local: or this: xhost +127.0.0.1. I prefer the first solution. Cesare

user257978
  • 41
  • 2