系统环境:Fedora13
问题描述:原本在panbin这个用户登录的情况下安装的chrome,在panbin这个用户登录的时候可以正常使用。
当使用root用户登录,打开chrome时提示以下错误:
Google Chrome can not be run as root.
Please start Google Chrome as a normal user.
To run as root, you must specify an alternate --user-data-dir for storage of profile information.
这个问题在网上有很多人在问,而且解决方法都是一样:用hexedit去编辑chrome文件,把geteuid改为getppid,过程如下:
1.搜索并安装hexedit:
#yum list hexedit
发现有这个包:
hexedit.i686 1.2.12-11.fc12 @fedora
于是安装:
#yum install hexedit.i686
2.用hexedit修改/opt/google/chrome/chrome文件
这里按照网上说的方法修改,提示文件为只读,不管用chmod怎么修改权限,还是提示只读。这里采用以下方法:
#cp chrome /root/
#hexedit /root/chrome
这样便可以修改/root/目录下的chrome了,打开chrome,按Tab键,再按Ctrl+s搜索geteuid,找到后,直接输入getppid,将会覆盖掉geteuid,最后按Ctrl+x保存。
3.将/root目录下的chrome复制回/opt/google/chrome/,覆盖掉原来的chrome文件即可。打开chome,现在可以正常使用了。
为什么这样改,原理我还不清楚。