解决ssh远程连接错误问题

时间:2023-03-09 05:31:28
解决ssh远程连接错误问题

使用 Xshell 远程连接服务器时,经常会出现这么个错误提示

WARNING! The remote SSH server rejected X11 forwarding request.

➜ ~ ssh -V

OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017

经过几经搜索,终于找到解决办法

1、安装xorg-x11-xauth

sudo yum install "xorg-x11-font*" xorg-x11-xauth

2、调整X11参数

X11UseLocalhost no
X11Forwarding yes

3、修改Xshell选项中的属性设置

解决ssh远程连接错误问题

注意:如果还是不可以的话尝试关闭防火墙试试。

防火墙对应的端口为:6010/tcp 6011/tcp

参考文献:

http://blog.51cto.com/soysauce93/1732298

https://docstore.mik.ua/orelly/networking_2ndEd/ssh/ch09_03.htm