I have connected my Workstation (Windows PC) via ssh with X11forwarding to a remote PC(CentOS Linux release 7.5.1804 ). The ssh connection works fine, but when I' try to open firefox or some other GUI I get the following error message: Error: cannot open display: :5. I also checked the /etc/ssh/sshd_config file if X11Forwarding is enabled and it is. I am using MobaXterm to establish a ssh connection, but i also tried putty or open ssh (ssh -Y user@rempte-adress) with the same result. echo $DISPLAY shows :5. Does anyone have any idea what's the problem is here?


if I try to start the X server with startx i get the following error message

xauth:  file /home/glock/.serverauth.23745 does not exist

Fatal server error:
(EE) PAM authentication failed, cannot start X server.
        Perhaps you do not have console ownership?
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
^Cxinit: giving up
xinit: unable to connect to X server: Connection refused
xinit: unexpected signal 2
Couldn't get a file descriptor referring to the console
  • 3
    Have you any running X11 server with active display? – Ipor Sircer May 23 '18 at 15:25
  • Did you install xauth? – xx4h May 23 '18 at 15:40
  • xauth is installed, but i think the X Server doesn't run. In my Question above u can see the output if i try to start the X Server. – seb2704 May 25 '18 at 10:48
  • Do you have a X server running on your Windows machine? You should not be trying to start X on the Linux machine over SSH – hardillb May 25 '18 at 11:11
  • The error "cannot open display: :5" suggests the DISPLAY variable is correctky set on centos side (which you still can check with 'echo $DISPLAY'), and xorg-x11-xauth rpm should be there. This means the issue may be on your PC: what X server are you running there? Xming? cygwin/X ? Some permission missing (xhost like ?) – tonioc May 25 '18 at 11:29

Your Answer

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

Browse other questions tagged or ask your own question.