Question

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?

Was it helpful?

Solution

Use

xdg-su -u user -c command

OTHER TIPS

xhost '+si:localuser:USERNAME'

Execute this command first:

$ sudo xhost +

Then run the command you want as the other user:

$ sudo -i -u username
$ command you want to run

When you are done:

$ sudo xhost -

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.

gksudo -u command

gksu -u <user> -c <command>

Replace <user> with the username to run the command as, and <command> with the command you want to run. Remember that the program will be run in the <user>s context, but in the current directory.

In the popping up window, enter the password of the target <user> of course.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top