[[emailprotected] ~]$ xhost + No protocol specified xhost: unable to open display "192.168.56.1:0.0" [[emailprotected] ~]$ env|grep DISPLAY DISPLAY=192.168.56.1:0.0 [[emailprotected] ~]$ exit logout [[emailprotected] ~]# env|grep DISPLAY DI
[[email protected] ~]$ xhost +
No protocol specified
xhost: unable to open display "192.168.56.1:0.0"
[[email protected] ~]$ env|grep DISPLAY
DISPLAY=192.168.56.1:0.0
[[email protected] ~]$ exit
logout
[[email protected] ~]# env|grep DISPLAY
DISPLAY=localhost:10.0
然后看看 /etc/hosts 发现了缺失 localhost
[[email protected] ~]# cat /etc/hosts
192.168.56.129 hdp-01
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.129 hdp-01 OJBK 了 [ [email protected] ~]# xhost + access control disabled, clients can connect from any host