.ICEauthority的一连串事(原创)

使用Ubuntu和Fedora的用户经常会在进入GNOME时出现Could not update /home/$USER/.ICEauthority这样的提示。然后就不能正常进入GNOME了(之前在GNOME上的配置都消失了)

解决办法:以root的用户执行chown $USER:$USER -R  /home/$USER/

                                             chmod 644 /home/$USER/.ICEauthority

解决问题很简单,但为什么会出现这种情况呢?下面是我的一些个人理解

首先:先介绍下sudo和gksudo

sudo和gksudo都是使用root权限来执行应用,sudo执行程序时使用的是当前用户的配置和家目录,而gksudo使用的是root用户 的家目录和配置,一般情况下看不出什么区别,但是对于那些针对不同用户有不同的配置文件和表现形式的应用程序来说,这两种方式的结果区别就很明显了。比如 下面原文中举的firefox例子。在不通过终端运行程序时,sudo没有办法提供一个界面来输入管理员密码,比如在快捷方式中。还有些GUI程序只能用 gksudo。细心的朋友肯定发现了,在/root下并没有.ICEauthority。那么当用sudo运行程序之后,由于使用的是当前用户的配置和家 目录,

系统将整个家目录的所属者和所属组归属到root:root下,并将.ICEauthority的权限修改成600。故当再次以普通用户身份登入系统时,由于没有权限故无法读取用户的配置文件。根据上述分析,显然,当使用gksudo将能避免这种情况的发生。
一般情况下,可以这样,运行命令行程序时使用sudo,运行GUI程序时用gksudo。

下面是原文:

What’s the Issue?
Since most Ubuntu documentation asks you to use sudo even with graphical applications, I often get asked by Ubuntu users why I recommendgksudo or kdesu for graphical applications instead of sudo.

For example, a lot of guides (including the first book ever published about Ubuntu) will ask you to type this sort of command:

sudo gedit /etc/apt/sources.list 

I will always recommend, however, that people use instead this sort of command:
gksudo gedit /etc/apt/sources.list 

And reserve sudo for command-line applications, like so:
sudo nano /etc/apt/sources.list 

Why is it an issue?
Well, to be perfectly honest, most of the time it isn’t. For a lot of applications, you can run them the improper way—using sudo for graphical applications and see no adverse side effects.

1. There are other times, though, when side effects can be as mild as Firefox extensions not sticking or as extreme as as not being able to log in any more because the permissions on your .ICEauthority changed. You can read a full discussion on the issue here.

These errors occur because sometimes when sudo launches an application, it launches with root privileges but uses the user’s configuration file.

For example, if you launch Firefox with the command
gksudo firefox 
it uses root’s Firefox configuration file.

But if you launch Firefox with the command
sudo firefox 

Change a few settings while launched as root, and you'll see if you dig into your Firefox profile that certain files are now owned by root.


it runs with root privileges but uses the user’s configuration file (in this case, you can see the homepage and theme are different).

2. Running graphical applications with sudo also has the downside of always having to be run from the terminal. If you don’t use the proper command—gksudo or kdesu, you will not be able to use the command as an icon launcher or keyboard shortcut because there will be no graphical dialogue box to enter your sudo password in.

3. There are also some graphical applications that simply will not run with the sudo command. Kate, for example, can be run as
kdesu kate

but cannot be run as
sudo kate

Why not make exceptions?
Bottom line: most of the time when you use sudo for graphical applications, it’s fine. Some of the time, though, it is not fine, and is, in fact, extremely bad.

If you made exceptions, you would have to give people a list of all the graphical applications that are okay to run as sudo and a list of all the graphical applications that must be run as gksudo or kdesu.

Why make a list that needs to be compiled and updated, that most people won’t refer to, and that is completely unnecessary? Just be consistent in suggesting good practice: gksudo and kdesu for graphical applications. sudo for command-line applications.

But gksudo sometimes gives me an error… even though it appears to work…

You may notice that even though gksudo is the proper way to launch graphical applications, if you launch a gksudo application it will sometimes give you what appears to be an error. This, for example:
( gedit:####): GnomeUI-WARNING **: While connecting to session manager:
Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed.

or t hese

Initializing nautilus-gdu extension
Nautilus-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error No such file or directory
Please ask your system administrator to enable user sharing.
That is not a real error, and there’s already been a bug report filed on the message appearing. The developers have seen the bug and labeled it a low priority. In the meantime, just ignore the message and keep encouraging people to not use sudo for graphical applications so they won’t potentially mess up their ~/.ICEauthority and other user configuration files.

 

参考至:http://www.psychocats.net/ubuntu/graphicalsudo

原创文章,转载请注明出处、作者

如有错误,欢迎指正
邮箱czmcj@163.com 

作者:czmmiao 原文地址:http://czmmiao.iteye.com/blog/1003810

时间: 2024-09-08 11:27:54

.ICEauthority的一连串事(原创)的相关文章

博客推广外链的那点事 原创博客依旧火爆

中介交易 http://www.aliyun.com/zixun/aggregation/6858.html">SEO诊断 淘宝客 云主机 技术大厅 做SEO少不了的就是外链,怎样获得高质量的外链是朋友们最关注的话题,到底什么样的外链是高主梁的外链呢?不用质疑,那就是用博客做高质量的外链,不禁有人要问了,现在的博客很难做,加个链接,写个产品信息,稍不留意博客就被封了,下面我来给大家总结下博客做链接的具体方法. 第一,首先选择优质的博客是非常重要的,不同的博客的权重是不同的,并且不同博客的收

搜狐焦点网遭遇合资纠纷 双方因“结婚还是同居”谈不拢

中介交易 SEO诊断 淘宝客 云主机 技术大厅 杨阳 一场"婚变",变化不是源于合作的失败,而是成功!一边说:我做为40%的股东想看财表,竟然需要找法院,借助法律;另一边说:我从未不配合查账. 日前北京焦点时间公司(下称"北京时间"),即搜狐与北京时间传媒文化有限公司(下称"时间传媒")的合资公司,向海淀法院起诉大股东搜狐公司不提供财务知情权一案,一审经海淀区法院宣判:搜狐必须在30天內备齐资料供北京时间传媒查看;但搜狐公司不服,还要上诉. 搜狐

商业价值杂志:民营出版业10年

一群人经历了10年的风雨没有退却,他们过去经历的困难,正在成就他们明天的力量. 罗赟| 文 尚文 汪海龙 韩英钊 民营出版正在成为中国出版产业不可或缺的一部分.据统计,目前全国除教材由国有出版社专营外,其余品种民营公司占据了50%-80%的市场份额.在畅销书,尤其是大众传播度最广的畅销书领域(少儿类图书除外),民营图书和带有民营色彩的出版商起码占据了90%. 来看看下列书目吧:<小团圆>.<杜拉拉升职记>.<盗墓笔记>.<藏地密码>.<明朝那些事儿&g

”谈谈原创那点事“之后的一点个人想法

上篇笔者在A5分享了一篇关于<百度频频算法更新,seoer再不升级就晚了>,当然作为人来说,谁不想快速升级,谁不想受到百度的青睐呢,百度推出"谈谈原创那点事"之后,可能很多seoer就开始退缩了,觉得是要跟百度说再见了吗,那也未必,笔者认为,如果真心去做了seo的人都会总结出属于他自己的seo套路,seo这个行业还真就是离不开内容这个产物,你做网站,没内容谁看,没新鲜感,谁理,不过作为seoer会接触到许许多多的行业seo单子,那么前期可能会需要花很多的时间去了解,还可能会

读关于原创的那些事有感

  昨天百度站长平台公布了<关于原创项目的那些事>一文,在文章中重点指出了百度对原创的看法,还有识别的技术等相关问题.大家也不妨去阅读一下原文,怎么说也是官方的资料,权威性是比较高的.在文章中,百度展示了扶持原创文章的意愿,再一次表明,会给予原创的网站更多的流量. 扶持原创一直在说,但是所谓的扶持原创,相信对于小站来说在短时间之内都不会得到什么福利.所以在这个文档中,真正受到笔者重视的应该这是关于采集的解释这里. 第一点是:采集冒充原创:把原创文章修改发布时间和来源等关键词信息,此类型的冒充原

原创的那些事:对于原创不收录的指引

昨天百度站长平台发布了最新的文档-谈谈原创项目的那些事,虽然得到了百度指出关于原创文章的一些权威信息,确实让笔者感受兴奋了一阵子,但是读完文章之后,感觉文章其实不过是一些老生常谈的话题了.比如关于采集和伪原创的说明,在去年的6.28事件中,相信不少站长已经尝到到了"甜头".因此,笔者并没有过多的去关注. 时间过去快一年了,受到了算法的影响,原创网站确实涌现了很多,有的网站依靠原创得到了排名,可是有的网站坚持原创却被埋没在信息海洋中.因此不少站长吐槽,原创真的有用吗?如果你的原创文章质量

谈谈原创项目那点事 起源算法四大可行之处

5月16号百度站长平台公布了原创星火计划,起源算法上线准备打持久战,对此各站长网站论坛和QQ群讨论声不少,自然是有人欢喜有人愁.这次的算法调整真的会有大的作用吗?原创真的迎来了春天? 站长,你还在吐槽别人对你的复制粘贴吗?你还在纠结原创被别人改版权吗?现在不用担心了,起源算法已经正式上线,原创星火计划正在实行.站长时刻在查看百度的动态,而百度每一个动作会影响一批批的站长,相信起源算法的实施又将会打击一批低质量的站点.对于起源算法的可行之处相信是大家讨论的焦点,守护今天想和大家探讨的就是这个话题,

说一下黑帽SEO和原创的那点事…

摘要: 大家都知道,质量高的文章会得到大量转发和转载从而提升排名. 这里我们说一下黑帽SEO和原创的那点事 一般一个新的博客出来了,内容方面一开始就是用自动采集工具+自动伪原创工 大家都知道,质量高的文章会得到大量转发和转载从而提升排名. 这里我们说一下黑帽SEO和原创的那点事- 一般一个新的博客出来了,内容方面一开始就是用自动采集工具+自动伪原创工具进行更新.这个方法屡用不爽而且比较省力,关键伪原创后文章需要保留你要做的关键词.然而我们也需要一些纯人工写的英文文章,最好母语是英文的. 为什么呢

百度站长平台:关于原创项目的那些事

站长网(www.admin5.com)5月17日消息,昨日a5报道了百度搜索结果页面开始对大型新闻门户网站进行原创内容标注,百度星火计划开始上线.随后百度站长平台SEO专家lee发布一篇关于原创项目的文章.文章主要讲了为什么要重视原创.采集很狡诈,识别原创很艰难.百度识别原创之路如何走?以下是具体内容. 一.搜索引擎为什么要重视原创 1.1 采集泛滥化 来自百度的一项调查显示,超过80%的新闻和资讯等都在被人工转载或机器采集,从传统媒体的报纸到娱乐网站花边消息.从游戏攻略到产品评测,甚至高校图书