Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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.

share|improve this answer
Ooh, looks like fun. Will have to stop being a neanderthal and use that in future :) – Tom Newton Aug 14 '09 at 19:49
You solved the issue I was having as well. Thanks!! – Bubnoff Apr 6 '12 at 2:48

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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