ssh X11 转发不起作用:错误:无法打开显示::5

ssh X11 转发不起作用:错误:无法打开显示::5

我已通过 ssh 使用 X11 转发将我的工作站(Windows PC)连接到远程 PC(CentOS Linux 版本 7.5.1804)。 ssh 连接工作正常,但是当我尝试打开 Firefox 或其他一些 GUI 时,我收到以下错误消息:Error: cannot open display: :5。我还检查了该/etc/ssh/sshd_config文件是否启用了 X11Forwarding,确实如此。我正在使用 MobaXterm 建立 ssh 连接,但我也尝试了 putty 或打开 ssh (ssh -Y user@rempte-adress) ,结果相同。echo $DISPLAY显示:5。有谁知道这里出了什么问题吗?

编辑

如果我尝试启动 X 服务器,startx我会收到以下错误消息

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

(EE)
Fatal server error:
(EE) PAM authentication failed, cannot start X server.
        Perhaps you do not have console ownership?
(EE)
(EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
(EE)
^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

相关内容