CentOS7 root下google-chrome不能运行解决方案

google-chrome为了安全考虑,拒绝在root用户下执行,在终端运行google-chrome输出,ERROR:zygote_host_impl_linux.cc(90)] Running as root without –no-sandbox is not supported. See https://crbug.com/638180.

chrome启动时添加 –no-sandbox ,以google-chrome %U --no-sandbox启动,修改启动文件gedit /usr/bin/google-chrome,添加如下代码:

if [[ -n "$CHROME_USER_DATA_DIR" ]]; then
  # Note: exec -a below is a bashism.
  exec -a "$0" "$HERE/chrome"  \
    --user-data-dir="$CHROME_USER_DATA_DIR" "$@"
else
  exec -a "$0" "$HERE/chrome"  --user-data-dir="/root/.config/google-chrome/"  \
    "$@" --no-sandbox
fi

 

你可能感兴趣的:(linux)