当使用su 到另外一个用户运行某个程序,而这个程序又要有图形显示的时候,就有可能有下面提示:

root@dt:~# sudo -i -u keji google-chrome
No protocol specified

(google-chrome:5146): Gtk-WARNING **: cannot open display: :0.0

这是因为Xserver默认情况下不允许别的用户的图形程序的图形显示在当前屏幕上. 如果需要别的用户的图形显示在当前屏幕上, 则应以当前登陆的用户, 也就是切换身份前的用户执行如下命令。

xhost +

通过执行这条命令,就授予了其它用户访问当前屏幕的权限,于是就可以以另外的用户运行需要运行的程序了

Gtk-WARNING **: cannot open display: :0.0之解决的更多相关文章

  1. MongoDB 由于目标计算机积极拒绝,无法连接 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061

    转载自:http://www.cnblogs.com/xiaoit/p/3867573.html 1:启动MongoDB 2014-07-25T11:00:48.634+0800 warning: F ...

  2. 【MongoDB】2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errno:10061 由于目标计算机积极拒绝,无法连接。

    1:启动MongoDB 2014-07-25T11:00:48.634+0800 warning: Failed to connect to 127.0.0.1:27017, reason: errn ...

  3. oracle Can't connect to X11 window server using ':0.0' /Checking monitor: must be configured to display at least 256 colors解决方法

    Can't connect to X11 window server using ':0.0' 解决方法 1. 以oracle 用户登陆X window 或者 2. root 身份执行 # xhost ...

  4. 阅读 video on-screen display v6.0笔记

    阅读 video on-screen display v6.0笔记 关于axi总线时钟的区分 需要弄清楚的是aclk, aclken, aresetn 信号是和video 有关的,axi4-lite的 ...

  5. Gtk-WARNING **: cannot open display: :0.0

    Gtk-WARNING **: cannot open display: :0.0 https://blog.csdn.net/Rong_Toa/article/details/80365932

  6. Linux启动应用(比如jmeter)报An error occurred: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

    Linux启动应用(比如jmeter)报An error occurred: Can't connect to X11 window server using ':0.0' as the value ...

  7. Xmanager用法(export DISPLAY=客户端IP:0.0)

    1.在用户的目录下找到文件.bash_profile或profile,用vi对其进行编辑.加入下列命令行: DISPLAY=192.168.88.71:0.0;export DISPLAY 2.如果只 ...

  8. Ubuntu python-matplotlib安装couldn't connect to display ":0.0"

    先卸载旧的matplotlib库(sudo pip3 uninstall matplotlib),再利用命令 sudo apt-get install python-matplotlib安装,自动安装 ...

  9. 解决configure: WARNING: You will need re2c 0.13.4 or later

    我在安装rabbitmq php扩展的时候发现 configure: WARNING: You will need re2c 0.13.4 or later if you want to regene ...

随机推荐

  1. asp.net中的时间日期选择控件

    asp.net中的时间日期选择控件 Posted on 2008-07-17 17:37 飛雪飄寒 阅读(22922) 评论(6) 编辑 收藏     在系统中经常需要进行时间日期选择(比如查询时间范 ...

  2. 建造者模式 build

    引出建造者模式: package com.disign.build; /** * Created by zhen on 2017-05-19. */ public class BuildPersonT ...

  3. ces

    1. 测试目录 1.1. 测试目录 2. 测试目录2 2.1 测试目录

  4. L204

    Riding a bike is good exercise and great fun. But what do you do with a bike after you outgrow it? N ...

  5. L175 Endorestiform Nucleus: Scientist Just Discovered a New Part of the Human Brain

    The newly named Endorestiform Nucleus sits in the inferior cerebellar小脑 peduncle, at the junction be ...

  6. maven 笔记:maven Could not create the Java Virtual Machine

    1.安装好maven,在cmd中运行mvn –v,报错:“maven  Could not create the Java Virtual Machine” 2.分析:这是跟jvm有关,在cmd中运行 ...

  7. try...except语句

    try: 执行语句 except 执行语句有异常就执行这一步 else: 执行语句没有异常就执行这一步 finally 不管有没有异常,这一步就要执行

  8. 使用RESTful风格整合springboot+mybatis

    说明: 本文是springboot和mybatis的整合,Controller层使用的是RESTful风格,数据连接池使用的是c3p0,通过postman进行测试 项目结构如下: 1.引入pom.xm ...

  9. 20155236 2016-2017-2 《Java程序设计》第六周学习总结

    20155236 2016-2017-2 <Java程序设计>第六周学习总结 教材学习内容总结 InputStream与OutputStream 从应用程序角度来看,如果要将数据从来源取出 ...

  10. WIN 10环境下JDK的安装和环境配置

    在做测试的过程中,诸如Selenium.Appium.Macaca.Airtest.RobotFramework.Jmeter等框架或工具都需要用到一样基础的环境JAVA JDK.最近刚好换了电脑,就 ...