When you try to run Google Chrome as root on CentOS, you will get the message "Google chrome can not be run as root".

This is because running Chrome as root you might end up corrupting important files and folders.

The workaround is to specify an alternate "--user-data-dir" for storage of profile information.

Follow the below steps to achieve this.

1. Open google-chrome in your favorite editor, eg nano:
# nano $(which google-chrome)
 
2. Add --user-data-dir at the very end of the file.
 
It might look something like this:
 
exec -a "$0" "$HERE/chrome"  "$PROFILE_DIRECTORY_FLAG" \   "$@"
--user-data-dir
 
3. Save, and close the editor.
 
4. Done.
 

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext