xshell出現(xiàn)WARNING!The remote SSH server rejected X11 forwarding request.
xshell出現(xiàn)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參數(shù)為no,可能這一行最開始是被注釋,去掉注釋,保存之后重啟sshd服務(wù),重新連接即可
[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包是否安裝,未安裝則進(jìn)行下面操作
[root@ShuaiJhou ~]# yum install xorg-x11-xauth


成功解決