超级权限运行 gedit 报错

报错

No protocol specified

Unable to init server: 无法连接: 拒绝连接
(gedit:6013): Gtk-WARNING **: 13:46:39.445: cannot open display: :0

~$ sudo gedit
No protocol specified
Unable to init server: 无法连接: 拒绝连接

(gedit:6013): Gtk-WARNING **: 13:46:39.445: cannot open display: :0

解决办法

将 gedit 添加到访问控制列表中 access control list

~$ xhost local:gedit
//添加成功,输出结果如下
non-network local connections being added to access control list
posted @ 2021-08-09 14:02  流水自净  阅读(1406)  评论(0编辑  收藏  举报