Error: Couldn’t open display (null) and solution

by nixcraft on May 3, 2006 · 1 comment

Q. I am trying to run X applications using secure shell (SSH). I connect to my server using ssh myserver.com. But when I run X application it dump me back with an error as follows:
Error: couldn't open display (null).

How do I fix this problem?

A. You are trying to use ssh X11 X11 forwarding. To enable X11 forwarding you need to pass either the -Y or -X options to SSH command. For example try:

$ ssh –X user@myserver.com

OR

$ ssh –Y user@myserver.com

Once logged in you can run X application:

[you@myserver.com ] $ xeyes &

Where,

  • -X: Enables X11 forwarding. X11 forwarding should be enabled with caution. Users with the ability to bypass file permissions on the remote host (for the user's X authorization database) can access the local X11 display through the forwarded connection. An attacker may then be able to perform activities such as keystroke monitoring. For this reason, X11 forwarding is subjected to X11 SECURITY extension restrictions by default.
  • -Y : -X may be not secure then use –Y (recommended). Enables trusted X11 forwarding. Trusted X11 forwardings are not subjected to the X11 SECURITY extension controls.

See also:

Featured Articles:

Share this with other sys admins!
Facebook it - Tweet it - Print it -

{ 1 comment… read it below or add one }

1 Deepak Wadhwani November 12, 2010

This works. Thanks.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 9 + 4 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: