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

来源:互联网 发布:广州南航信息中心 知乎 编辑:程序博客网 时间:2024/05/20 07:38

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

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

ubuntu@ubuntu-armhf:~$ startx &[1] 9612ubuntu@ubuntu-armhf:~$ xauth:  file /home/ubuntu/.Xauthority does not existX: 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设置,它接受如下三个值:

  1. root
  2. anybody
  3. console

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

执行命令 dpkg-reconfigure x11-common

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

dpkg-reconfigure x11-common

然后就可以在图形用户界面中进行设置:
这里写图片描述

0 0
原创粉丝点击