在linux的su模式下,打开xterm遇到以下提示:
root@ubuntu:/home/ubuntu# xterm
No protocol specified
Warning: This program is an suid-root program or is being run by the root user.
The full text of the error or warning message cannot be safely formatted
in this environment. You may get a more descriptive message by running the
program as a non-root user or by removing the suid bit on the executable.
xterm: Xt error: Can't open display: %s
解决方法:
gedit /etc/profile
然后在最下面加这样一句:
export XAUTHORITY=/home/ubuntu/.Xauthority xterm(这里的xterm可以换成你自己的x-play应用)
保存退出,并执行:
source /etc/profile
就成功了: