我如何以root身份运行Google Chrome? [英] How do I run Google Chrome as root?
问题描述
我已在Ubuntu 10.10中安装Google Chrome。当我尝试在普通用户中使用时,它工作正常。
I have installed Google Chrome in Ubuntu 10.10. When I try to use in normal user, it is working fine.
现在,如果我想用作root用户,它会出现以下错误:
Now if I want to use as a root it gives the following error:
谷歌浏览器不能以root身份运行
Google Chrome does not run as root
Also when I tried the following command in terminal, it opens Google Chrome:
google-chrome --user-data-dir
我需要一个永久解决方案。任何人都可以给我这个想法吗?
I need a permanent solution for this. Can anybody give me idea about this?
推荐答案
- 关闭Xorg访问控制:
xhost +
- 现在以普通用户匿名身份启动Google Chrome:
sudo -i -u anonymous / opt / google / chrome / chrome
- 完成浏览后,重新启用Xorg访问控制:
xhost -
更多信息: Howto以root身份运行google-chrome
- switch off Xorg access control:
xhost +
- Now start google chrome as normal user "anonymous" :
sudo -i -u anonymous /opt/google/chrome/chrome
- When done browsing, re-enable Xorg access control:
xhost -
More info : Howto run google-chrome as root
第二种解决方案:
编辑文件 / opt / google / chrome / google-chrome
找到 exec -a$ 0$ HERE / chrome$ @
或 exec -a$ 0$ HERE / chrome$ PROFILE_DIRECTORY_FLAG\$ @
更改为 exec -a$ 0$ HERE / chrome$ @--user-data-dir/root/.config/google-chrome
Second solution:
Edit the file /opt/google/chrome/google-chrome
find exec -a "$0" "$HERE/chrome" "$@"
or exec -a "$0" "$HERE/chrome" "$PROFILE_DIRECTORY_FLAG" \ "$@"
change as exec -a "$0" "$HERE/chrome" "$@" --user-data-dir "/root/.config/google-chrome"
第三:
运行Google Chrome浏览器作为Ubuntu Linux系统上的根目录
这篇关于我如何以root身份运行Google Chrome?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!