Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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

Some time back, (maybe a year?), my environment was working correctly. But some time in the last year or so I started getting "can't open display" errors.

It's weird because I can ssh into the ubuntu box, (from a mac, over cisco ipsec), and start several new x11 clients. But at some point, (1 - 20 minutes later), new attempts to start x11 clients result in "can't open display" errors. If there's any other antecedent event that leads to the "can't open display" problem, I havent' figured it out.

My DISPLAY hasn't changed in this time. Preexisting windows continue to exist and function so I believe my local X11 server is good, running, and that the previously existing X11 forwarding tunnels are still functioning. It appears to be a problem with the initial rendezvous to the display.

Does this sound familiar to anyone?

share|improve this question

You're seeing the effects of the ForwardX11Trusted option being turned off in ~/.ssh/config. When this option is set to no, remote X clients have fewer permissions on the local X server; this removes some ways in which the administrator of the remote machine can harm yours, but not all of them, so it is not an effective security measure. In addition, this option prevents new X clients from connecting if more than 20 minutes have elapsed since the connection was established.

Ubuntu has this option default to off, but the upstream default has it on. The client machine you're using must have been upgraded or had its configuration changed. Turn on ForwardX11Trusted in your ~/.ssh/config by adding the lines

Host *
ForwardX11Trusted yes

Recent versions of ssh allow the delay to be configured through the ForwardX11Timeout option, so you can leave ForwardX11Trusted off (for whatever benefit it might provide) and set a very high timeout.

share|improve this answer

I have the same issue,

on the remote server

1) Adding the following to your sshd_config

AddressFamily inet

2) Restart SSH


share|improve this answer
also works on ubuntu 14.04. – hiro protagonist Oct 1 '15 at 9:47

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.