我如何修复 SSH X 转发错误 "X11 connection rejected because of wrong authentication"

问题:

我使用 X 转发连接到服务器

ssh_connect_command.txt
ssh -CX user@server

但当我在服务器上启动图形应用程序时,我看到以下错误消息:

gparted_x11_error_output.txt
user@server $ gparted
X11 connection rejected because of wrong authentication.
Unable to init server: Could not connect: Connection refused

(gpartedbin:70357): Gtk-WARNING **: 00:06:19.612: cannot open display: localhost:11.0

解决方案

我在此 StackOverflow 帖子中找到了解决方案:

fix_xauth_merge.sh
sudo --preserve-env=DISPLAY -s
xauth merge /home/user/.Xauthority

注意你需要将 /home/user 替换为适当的家目录。


Check out similar posts by category: Linux