Server Fault is a question and answer site for system and network administrators. 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

From my desktop, I can get to my wife's machine on the lan using: ssh -X user@ Both systems are running the desktop flavour of Ubuntu 9.10-64bit.

But here is the problem: When I try to run X apps like gedit, it fails with the following error message on the remote end of the ssh connection: "X11 connection rejected because of wrong authentication".

The strange thing is, if I run the app with "sudo" such as "sudo gedit" then everything works fine: I get the X application forwarded through my ssh connection and showing up on my desktop, even though it is actually running on the remote machine.

What have I missed, or where do I check to see exactly what permission failure is giving me problems when running as non-sudo?

share|improve this question
up vote 5 down vote accepted

Uncomment the below in /etc/ssh/ssh_config on both machines.

ForwardX11 yes
ForwardX11Trusted no
share|improve this answer
That makes perfect sense. This remote box has a ssh_config file based on a Debian 5 example instead of the usual Ubuntu one. Thanks. – Stéphane Nov 15 '09 at 18:48

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.