---
title: 验证时报“cannot connect to X server”错误
description: "运行验证中报错“PipedViewerPQ: cannot connect to X server”。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/openmind_kunpengpyferret_02_0015.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/openmind_kunpengpyferret_02_0015.html
indexId: 1621dccd1832e19033f557e11a09cf1f7760fa94802f8ac35167bf089f36c0cd79
---
# 验证时报“cannot connect to X server”错误

#### 问题现象描述

运行验证中报错“PipedViewerPQ: cannot connect to X server”。


#### 关键过程、根本原因分析

X11-forwarding未开启。


#### 结论、解决方案及效果

1. 执行以下命令退出当前界面。

```
CTRL+ Z
```


2. 执行以下命令。

```
yum install -y xorg-x11-xauth xorg-x11-fonts* xorg-x11-font-utils xorg-x11-fonts-Type1 xclock
```


3. 执行以下命令修改“/etc/ssh/sshd_config”文件。

  a. 打开“/etc/ssh/sshd_config”文件。

```
vi /etc/ssh/sshd_config
```


  b. 按“i”进入编辑模式，将第100行的X11Forwarding改为“yes”。
    执行3.a之后，按“Esc”键，输入“:set nu”，按“Enter”即可显示出行号。

  c. 按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。
4. 执行以下命令重启sshd服务。

```
systemctl restart sshd
```


  重新打开ssh窗口，连接服务器，X11-forwarding显示为对钩，表示开启成功。

5. 重新执行7操作。
