您的位置:首页 > 其它

解决 "X: user not authorized to run the X server, aborting."

2016-07-29 17:48 961 查看

解决 “X: user not authorized to run the X server, aborting.”

当我们在linux系统中安装完成Xorg和相应的桌面环境的时候,以普通用户身份执行
startx
命令的时候,有时会提示以下错误:

ubuntu@ubuntu-armhf:~$ startx &
[1] 9612
ubuntu@ubuntu-armhf:~$ xauth:  file /home/ubuntu/.Xauthority does not exist

X: user not authorized to run the X server, aborting.


在linux系统中,默认root用户被允许执行X服务器,所以当你以root用户执行
startx
的时候不会遇到这种错误提示。在这种情况下我们需要配置X服务器,让它能够允许普通用户执行。配置方法有两种:

直接修改配置文件/etc/X11/Xwrapper.config

在配置文件
/etc/X11/Xwrapper.config
中有一个
allowed_users
设置,它接受如下三个值:

root

anybody

console

allowed_users=anybody
,则普通用户也可以正常执行
startx


执行命令 dpkg-reconfigure x11-common

在debian类系统中,比如ubuntu中,可以执行如下命令:

dpkg-reconfigure x11-common


然后就可以在图形用户界面中进行设置:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  ubuntu Xserver X