0

For security reasons, I would like to run Firefox under a different (underprivileged) account. I thought it would be as easy as setting up a user and then run with gksudo, but it appears that there is more to it. What am I doing wrong?

tkn@tkn-desktop-ubuntu $ sudo useradd tkn-firefox
tkn@tkn-desktop-ubuntu $ gksudo -u tkn-firefox firefox
No protocol specifiedError: cannot open display: :0.0

I'm guessing that the user doesn't get access to X11 for some reason, but shouldn't gksudo do that?

2 Answers 2

3

Using 'xhost +' is a bad habit to get into. If you're having a problem with X11 and "can't open display ??:?", use xauth to exchange cookies and set the DISPLAY variable in the new environement.

In this case, I've had success on Ubuntu 9.04 getting gksu to do that heavy lifting. (It didn't work for me til I added the --su-mode )

$ gksu --su-mode -u tkn-firefox firefox

It does spit out a message about 'Warning: Tried to connect to session manager, None of the authentication protocols specified are supported' but it appears to work otherwise.

2
  • Ooh, looks like fun. Will have to stop being a neanderthal and use that in future :)
    – Tom Newton
    Aug 14, 2009 at 19:49
  • You solved the issue I was having as well. Thanks!!
    – Bubnoff
    Apr 6, 2012 at 2:48
0

I find I have to do "xhost +" (if there are any more potential X clients on your network, be a bit more selective) and don't "su -", just "su". I have not really thought about why this might be, but it works OK for me.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.