views:

400

answers:

4

I have ubuntu + x11 + gnome.

I want to run a graphical application as another user.

However, when I start it from the command line using sudo -u otheruser app I get the error "No protocol specified".

How can I work arround this?

A: 

You probably need to tell your X server to accept connections from another user than the one owning the server instance (you). Look into the xhost command.

unwind
+1  A: 

Execute this command first:

$ xhost local:
codeape
+1  A: 

Use

xdg-su -u user -c command
Robert Munteanu
I believe you still need to use xhost to allow local connections from any user.
codeape
man xdg-su: xdg-su is for use inside a desktop session only.
Robert Munteanu
A: 

gksudo -u command

Tried this on my Ubuntu desktop, it did not work (same error msg. as in question).
codeape