我如何修复 SSH X11 forwarding sudo: Unable to init server: Could not connect: Connection refused

问题:

当我尝试运行 sudo gparted 时,出现以下错误:

x11_error.txt
X11 connection rejected because of wrong authentication.
Unable to init server: Could not connect: Connection refused

(gpartedbin:29293): Gtk-WARNING **: 01:55:02.070: cannot open display: localhost:10.0

解决方案

对我来说,解决方案是将我登录的用户 uli 的 .Xauthority 文件复制到 root

copy_xauthority.sh
sudo cp ~$USER/.Xauthority /root

因为这是以 root 运行的 X11 程序正确登录到我的本地 X11 服务器所必需的。


Check out similar posts by category: Linux