1
2
3
4
5
6
7
sudo gedit XXX.txt
No protocol specified

Unable to init server: 无法连接:拒绝连接

(gedit:2955): Gtk-WARNING **: 06:57:20.038: cannot open display: :0.0

解决方法:

1
2
~$ xhost local:gedit
non-network local connections being added to access control list