如何在CentOS和Fedora上以root用户身份运行Google Chrome

默认不能以root用户身份运行Google Chrome。 如下需改是让root用户运行Google Chrome的一种简单方法。

打开终端(应用程序–>系统工具–>终端)。

编辑/usr/bin/google-chrome并在最后一行的末尾添加

“ --no-sandbox --user-data-dir ”。

# vi /usr/bin/google-chrome

修改之前

exec < /dev/null

exec > >(exec cat)

exec 2> >(exec cat >&2)

 

# Note: exec -a below is a bashism.

exec -a "$0" "$HERE/chrome" "$@"

修改之后

exec < /dev/null

exec > >(exec cat)

exec 2> >(exec cat >&2)

 

# Note: exec -a below is a bashism.

exec -a "$0" "$HERE/chrome" "$@" --no-sandbox --user-data-dir

就这样。现在,您可以从菜单中以root身份启动Google Chrome。

 

猜你喜欢

转载自blog.csdn.net/allway2/article/details/108816036