我正在尝试打开用户设置以解锁用户编辑其用户设置的能力。当我尝试使用我的 root 帐户打开 Gnome 控制中心时,出现以下错误
root@penguin:~# XDG_CURRENT_DESKTOP=GNOME gnome-control-center
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
(gnome-control-center:7565): Gtk-WARNING **: 09:54:42.877: cannot open display:
root@penguin:~#
更新:将显示设置为:0 后,我现在得到
root@penguin:~# XDG_CURRENT_DESKTOP=GNOME gnome-control-center No protocol specified Unable to init server: Could not connect: Connection refused No protocol specified Unable to init server: Could not connect: Connection refused
解决了感谢所有帮助过的人
答案1
尝试
$ sudo su
# gnome-control-center
最好能解释一下为什么要gnome-control-center
以 root 身份运行。
答案2
我弄清楚了这是主机权限问题,执行xhost
+ 以允许从所有主机访问
aidensnyder@penguin:~$ xhost
access control enabled, only authorized clients can connect
aidensnyder@penguin:~$ xhost +
access control disabled, clients can connect from any host
aidensnyder@penguin:~$