"xhost +" produce access control disabled message but do not works

When under kubuntu enter command xhost + I got answer:

access control disabled, clients can connect from any host

But when try running X application under different user (su - username) I got answer:

Error: Can't open display:

Connected link:"Can't open display" even after access with xhost

EDIT

Yes, $DISPLAY was empty. I obviously get used that it is always set correctly. Thanks Arjen.

1 Answer

X-applications try to connect to the X-server that is referred to in the environment variable DISPLAY. Enter echo $DISPLAY to show its current value. It should look like :0 or localhost:0.

When starting the su-shell with su - username, all environment variables will be cleared. This is a security measure.

You can start the X application in su-mode with DISPLAY=:0 xapplication (substitute :0 with the value that was shown with the echo command).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like