38.xshell出现WARNING!The remote SSH server rejected X11 forwarding request.

xshell出现WARNING!The remote SSH server rejected X11 forwarding request.

xshell出现WARNING!The remote SSH server rejected X11 forwarding request.

The remote SSH server rejected X11 forwarding request.
The remote SSH server rejected X11 forwarding request.

The remote SSH server rejected X11 forwarding request.

[root@ShuaiJhou ~]# vim /etc/ssh/sshd_config
在X11这行改为X11Forwarding yes,
然后再将UseLogin参数为no,可能这一行最开始是被注释,去掉注释,保存之后重启sshd服务,重新连接即可

[root@ShuaiJhou ~]# vim /etc/ssh/sshd_config 

# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
# WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several
# problems.
UsePAM yes

#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation sandbox
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#ShowPatchLevel no
#UseDNS yes
#PidFile /var/run/sshd.pid

[root@ShuaiJhou ~]# systemctl restart sshd

如果还不行检查 xorg-x11-xauth 的rpm包是否安装,未安装则进行下面操作

[root@ShuaiJhou ~]# yum install xorg-x11-xauth

成功解决
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容