Ubuntu 12.10: Open an application with another user's privileges in sudo (main) GUI workspace

0

  1. I want to log in as the (main) sudo user...
  2. and in the terminal su - to another userB
  3. and use Firefox with the userB privileges in the main (sudo) user's GUI but in another workspace.

Is this possible? I am able to go through steps 1 and 2, but when I start Firefox I get the error below:

electron@electron:~$ su - arc
Password: 
$ firefox &
$ No protocol specified
No protocol specified
Error: cannot open display: :0

[1] + Done(1)                    firefox

PS: I am a beginner. I know this may be a stupid thing to do, I am just curious ;-)

inithin

Posted 2013-08-25T11:52:21.770

Reputation: 1

Answers

0

try to do this by saying:

sudo -u userB firefox

So first sudo -u specifying that you want to impersonate someone else, then the username of the user you want to impersonate (userB comes from your example), and the the process that you want to run as this user.

FvD

Posted 2013-08-25T11:52:21.770

Reputation: 313

Still not working..

electron@electron:~$ sudo -u userB firefox [sudo] password for electron: No protocol specified No protocol specified Error: cannot open display: :0 – inithin – 2013-08-25T12:31:48.483

Maybe this has to do with the xauth cookies. Try the recipe that is given here to get past the "no display" message.

– FvD – 2013-08-25T13:12:30.450

There is also an ubuntu issue with this solution mentioned on launchpad. If you are using ubuntu, maybe that is causing the problem.

– FvD – 2013-08-25T13:22:28.847