Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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

I'm trying to open netbeans as a different user, but isn't working. I'm running a Kubuntu 12.04 LTS with KDE.

And I tried the following: Open a terminal, type su - myotheruser, type the myotheruser password. Then tried to open netbeans: /opt/netbeans/7.3/bin/netbeans (netbeans is installed on /opt/netbeans/7.3).

I got the following:

Erro: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

I tried some commands like export DISPLAY=":0.0", xhost +, xhost +local:all and other commands related here and here. None worked.

Is important to me that myother user not be in the sudoers file.

If I end the session with mycurrentuser and logon with the myotheruser I can easily open netbeans.

I need open netbeans as myotheruser because I would like to work on a project that belongs to this user and just to it. If I changes permissions, looks like when I versionnig the project the user will loose the exclusivity.

So, how can I solve this? How can I open netbeans as a different user inside of another user display?

share|improve this question
up vote 4 down vote accepted

You could always try the following:

ssh -Y otheruser@localhost "/opt/netbeans/7.3/bin/netbeans"


share|improve this answer
Thx a lot, works @tink. – GarouDan May 5 '13 at 23:28

I use gksu:

gksu -u myotheruser /opt/netbeans/7.3/bin/netbeans

Maybe try also kdesu.

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.