问题
无法为特定的普通用户使用以下命令启动 xclock 窗口。
对于 root 用户,启动xclock没问题。
$ xclock Error: Can't open display: [hostname]:x.y
www. On IT Road .com
解决方案
在文件 /home/[username]/.bash_profile 下设置的用户级环境变量不正确。
请按照以下步骤解决问题。
以普通用户登录。
注释掉文件 /home/[username]/.bash_profile 下所有用户特定的 env 变量。
启动 VNC 控制台。
执行 xclock 命令并检查(注意:这不是唯一的原因和解决方案,而是可能的原因之一。
)
例如:
从文件 /home/[username]/.bash_profile 中注释掉以下几行后,问题得到解决。
$ cat /home/[username]/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export DISPLAY=xxx.xxx.xxx.xxx:4.0 export TMPDIR=/opt/tmp export TEMP=/opt/tmp export TMP=/opt/tmp export PATH=$PATH:$HOME/bin . /d01/oracle/RDBA/EBSapps.env export PATCH_TOP=/d01/oracle/RDBA/fs_ne/EBSapps/patch export CONFIG_JVM_ARGS="-Xms1024m -Xmx2048m"
日期:2020-09-17 00:14:15 来源:oir作者:oir