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?

troelskn
  • 229
  • 1
  • 2
  • 11

2 Answers2

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.

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.

Tom Newton
  • 4,141
  • 2
  • 24
  • 28