X11 Forwarding Refused

When starting an SSH session, if you get the error Cannot Open Display in X-Win32’s status window, the remote host may not have X11 Forwarding (or X11 Tunneling) enabled. SSH sessions use X11 Forwarding by default to connect the remote X Client (e.g. xterm, konsole, mozilla, firefox, dtterm, gnome-terminal, etc.) back to X-Win32.

To fix this problem you need to enable X11 forwarding on your remote ssh server (or sshd, typically OpenSSH):

  1. Find your sshd_config file
    1. For OpenSSH on Linux, this is typically located at /etc/ssh/sshd_config (note: this is not the same as /etc/ssh/ssh_config, which is used for configuring the ssh client settings)
    2. Read the man page for sshd_config, which may specify the location of the file (run man sshd_config)
    1. If you still cannot find the file, run find / -maxdepth 3 -name sshd_config to try to find it
    2. Edit the file as root
    3. Find the line
      X11Forwarding no

      or the line

      #X11Forwarding no
    4. Change the line to
      X11Forwarding yes
    1. Save the file
  1. Restart sshd

    You can enable X11 Forwarding on an individual user basis.

  2. Create or Edit the $HOME/.ssh/config file
  1. Add the line
    ForwardX11 yes