`

No protocol specified (gedit:2699): Gtk-WARNING **: cannot open display: :0.

 
阅读更多

今天在终端下使用gedit时突然出现下面的错误:

No protocol specified

(gedit:14333): Gtk-WARNING **: cannot open display: :0.0

开始还以为自己误操作将什么配置文件弄坏了,后面网上查资料发现是使用了sudo的问题,因为我喜欢用sudo su命令切换到sudo下玩。

下面时网上搜索到的解决办法。

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

(gedit:14333): Gtk-WARNING **: cannot open display: :0.0

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

xhost +

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

分享到:
评论
2 楼 java_doom 2014-10-12  
naomibyron 写道
我专门注册了一个ITEYE账号,就为了对你说声谢谢,对我帮助很大

1 楼 naomibyron 2014-08-03  
我专门注册了一个ITEYE账号,就为了对你说声谢谢,对我帮助很大

相关推荐

    linux系统安装oracle数据库详解

    warning: Cannot convert string "-isas-song ti-medium-r-normal--*-140-*-*-c-*-gb2312.1980-0" to type 错误四 Checking kernel parameters Warning 错误五 Checking physical memory requirements 错误六 ...

    官网下载:Windows-KB841290-x86-ENU.zip

    When both alg are specified, it's now done in one pass. Fciv 2.03: Added -wp and -bp options. Fciv now stores full path or relatives paths. Fciv 2.04: Removed several options to simplify it. Fciv ...

    EurekaLog_7.5.0.0_Enterprise

    No files are copied to \bin folder of IDE. Run-time package (EurekaLogCore) is copied to Windows\System32 folder. Refer to help for more info. 2)....Added: RAD Studio 10.1 Berlin support 3)....Added:...

    grpc-api-1.24.0-API文档-中英对照版.zip

    赠送jar包:grpc-api-1.24.0.jar; 赠送原API文档:grpc-api-1.24.0-javadoc.jar; 赠送源代码:grpc-api-1.24.0-sources.jar; 赠送Maven依赖信息文件:grpc-api-1.24.0.pom; 包含翻译后的API文档:grpc-api-...

    七牛(com.qiniu)一些jar包资源(qiniu-java-sdk和happy-dns-java)

    1、qiniu-java-sdk:7.2版本所有版本jar包和6.1.71、6.1.9两个版本jar包。 2、happy-dns-java:0.1.1至0.1.6各版本jar包。

    kubernetes-dashboard.yaml

    # If not specified, Dashboard will attempt to auto discover the API server and connect # to it. Uncomment only if the default does not work. #- --apiserver-host=http://192.168.140.129:8080 ...

    ksoap2-android-assembly-3.0.0-jar-with-dependencies.jar

    修改后的jar包,原始的包,打包签名的时候会出现错误,因为里边有可系统自带的类重复的,这个已经删除了。。如果你只是用来连接webservice的话就直接用可以了,代码混淆里也不需要多余的操作。 ...

    wget-1.11.4-1

    --prefer-family=FAMILY connect first to addresses of specified family, one of IPv6, IPv4, or none. --user=USER set both ftp and http user to USER. --password=PASS set both ftp and ...

    oss-sdk-demo 阿里云开放云存储服务Demo

    The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. endpoint 根据自己选择的节点选择; SDK 中的endpoint 就是指...

    make.exe希望对你有用

    make.exe c msys mingw 网上找了很多都不能用,后来找到了这个,希望对你有帮助

    RoaringBitmap-0.7.45-API文档-中英对照版.zip

    赠送jar包:RoaringBitmap-0.7.45.jar; 赠送原API文档:RoaringBitmap-0.7.45-javadoc.jar; 赠送源代码:RoaringBitmap-0.7.45-sources.jar; 赠送Maven依赖信息文件:RoaringBitmap-0.7.45.pom;...

    greenplum-db-6.2.1-rhel7-x86_64.rpm

    greenplum-db-6.2.1-rhel7-x86_64.rpm Pivotal Greenplum 6.2 Release Notes This document contains pertinent release information about Pivotal Greenplum Database 6.2 releases....[WARNING]:-********

    warning ..\package.json: No license field

    在初始化Vue项目的的时候发现警告 yarn install 查了下发现是,package.json 文件中缺少license参数 { name: movie_view, version: 0.1.0, license: MIT, private: true, ... serve: vue-cli-service serve, ...

    net-snmp 5.9.1 编译好的 静态编译 都是说怎么编译,没一个编译好给下载用的

    No hostname specified. USAGE: snmpwalk [OPTIONS] AGENT [OID] Version: 5.9.1 Web: http://www.net-snmp.org/ Email: net-snmp-coders@lists.sourceforge.net OPTIONS: -h, --help display this help ...

    Specified_Time_Range_Candles - MetaTrader 5脚本.zip

    Specified time range candles (指定时间范围烛形)指标

    GetSystemFirmwareTable获取系统BIOS等信息(visual 20)

    利用window api函数,获取bios信息,解析 GetSystemFirmwareTable结构体。 开始获取SmBios信息: ------------------------------------... Part Number: *******-CRC ----------------------------------------------

    TMS Component Pack v8.3.4.0 - Delphi 10.1 Berlin Full Source

    - Fixed : Issue with toolbar button drawing in hot & down state when no glyph is specified - Fixed : Issue with QAT height when not using the QAT on a TAdvToolBarForm Update : ...

    opensc-0.12.0.tar.gz

    * Update library version to 1:0:0, as we are no longer compatible with the 0:*:* line, I fear. New in 0.9.3; 2004-10-31; Andreas Jellinghaus: * Fix some LDFLAGS/LDADD issues for parallel build. New...

    apache-maven-3.6.3-bin.zip

    apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-bin.zip maven3,6版本, 可用apache-maven-3.6.3-...

    编译好的x265,带y4m文件

    --[no-]open-gop Enable open-GOP, allows I slices to be non-IDR. Default enabled -I/--keyint <integer> Max IDR period in frames. -1 for infinite-gop. Default 250 -i/--min-keyint <integer> Scenecuts ...

Global site tag (gtag.js) - Google Analytics