X11: run a gnome app as another user

我怕爱的太早我们不能终老 提交于 2019-12-03 05:51:33

问题


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?


回答1:


Use

xdg-su -u user -c command



回答2:


xhost '+si:localuser:USERNAME'




回答3:


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 -



回答4:


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.




回答5:


gksudo -u command




回答6:


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.



来源:https://stackoverflow.com/questions/1124171/x11-run-a-gnome-app-as-another-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!