I ssh tunnel into a remote desktop running Ubuntu via a terminal - and use gnu screen to do my work there. I have enabled X11 forwarding in my ssh config for the use of X11 applications launched from one of screen's tabs.

Every few hours though, I cannot launch a new app (say for example emacs) - the message is that connection to localhost:10 display failed.

So something that works when I reattach to a screen session stops working for a while.

Any ideas as to how to solve this?

  • Do you have "trusted mode" (ssh -Y or ForwardX11Trusted yes) enabled? – grawity Jun 1 '12 at 18:45
  • @grawity: No - I don't. – user64752 Jun 1 '12 at 18:49

It's probably caused not by Screen, but by the X11 security features in OpenSSH. By default, forwarded connections are in "untrusted" mode, with restricted access to certain features, and a time limit for the X11 authentication data.

Try enabling "trusted" mode by adding the -Y option to ssh, and/or the following into your ~/.ssh/config:

Host yourserver
    ForwardX11Trusted yes
  • Actually it turns out that even with trusted ssh tunnel, I am still losing the display connection. Any ideas as to how I may debug this? – user64752 Jun 4 '12 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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