/repo/atxuser/TEST_PACKAGES/robot/PACKAGES/bin/python
Python 2.7.11 (default, May 25 2016, 07:17:40)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import wx
>>> a = wx.PySimpleApp()
Unable to access the X Display, is $DISPLAY set properly?
#xterm
No protocol specified
xterm Xt error: Can't open display: :1.0
这个问题该如何解决呢?
1.用root登陆
2.执行xhost +
3.su - mysql
现在就可以执行xterm了;
以下是man xhost的部分解释:
The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X
server. In the case of hosts, this provides a rudimentary form. of privacy control and security. It is only sufficient
for a workstation (single user) environment, although it does limit the worst abuses. Environments which require more
sophisticated measures should implement the user-based mechanism or use the hooks in the protocol for passing other
authentication data to the server.
以下信息摘抄自别人blog, 并没有全部验证,
xhost + 是使所有用户都能访问Xserver.
xhost + ip使ip上的用户能够访问Xserver.
xhost + nis:user@domain使domain上的nis用户user能够访问
xhost + inet:user@domain使domain上的inet用户能够访问。
上面的操作在本机挺好的;
但是如果想要访问远程机器的xterm, 那么就有些麻烦了;
1) ssh -X root@remote_server_ip; 这里-X一定需要,什么作用,去查ssh --help
2) 在当前用户下, 需要有.Xauthority文件,并且这个文件的owner:group需要是自己;
知道了觉得也不难, 不知道的时候觉得非常痛苦..