Friday, 5 August 2016

How to run chrome as root user in Ubuntu

By default google-chrome will run as under the normal user. You would get following error if you run chrome as root user
Google Chrome can not be run as root.
Please start Google Chrome as a normal user.
run as root, you must specify an alternate 
--user-data-dir for storage of profile information.
 
ubuntu chrome run as root error

To run chrome as root user follow these steps
Open /opt/google/chrome folder
open google-chrome file
ubuntu chrome run as root file location
Append last line of file with '--user-data-dir $HOME'
Actual line
exec -a "$0" "$HERE/chrome" "$@"
Appended line
exec -a "$0" "$HERE/chrome" "$@" --user-data-dir $HOME
Save and close the file
ubuntu chrome run as root modified file
Now run chrome as root user also.
ubuntu chrome running as root user

No comments: