1

Installed OpenBSD with all the sets and using the default FVWM2.

I log in to FVWM2, open xterm:

$ echo $DISPLAY
:0
$ 

And "su -" to root and create a normal user:

useradd -m TESTUSER

ok! Now I:

# su - TESTUSER
$ export DISPLAY=":0" 
$ xcalc               
No protocol specified
Error: Can't open display: :0
$

If I try (with the normal user with I logged in to FVWM2):

$ xhost +

Then it works (the "TESTUSER" can launch xcalc)! But I don't want to allow any to connect to my X server. Only a given local user. But I cannot add the local user:

$ xhost +local:TESTUSER    
non-network local connections being added to access control list
$ xhost              
access control enabled, only authorized clients can connect
LOCAL:
$ 

With the "LOCAL:" I think I enable all the local users, which is BAD.

Q: How to only enable the given local useR?

4
  • does export DISPLAY=:0.0 change anything? Commented Dec 10, 2017 at 20:15
  • updated question, found something
    – Hessnov
    Commented Dec 10, 2017 at 20:28
  • Have a look at xauth and .Xauthority. Users must be authenticated (MIT magic cookie) before being able to use the X server. Much safer than xhost.
    – dirkt
    Commented Dec 11, 2017 at 7:58
  • wow, thanks, but why is it safer?
    – Hessnov
    Commented Dec 11, 2017 at 22:34

1 Answer 1

2
$ xhost +si:localuser:TESTUSER

worked with the user that started the X (FVWM2)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .