Results 1 to 10 of 10

Thread: Howto run google-chrome as root

Hybrid View

  1. #1
    Join Date
    Feb 2008
    Location
    readlink("/proc/self/exe"
    Beans
    1,120
    Distro
    Ubuntu Development Release

    Wink Howto run google-chrome as root

    DISCLAIMER/Warning: Running anything as root is risky and you should not run any software as root when you don't have to. If you don't know what you're doing, or are on a system that needs to be secure, leave now.


    If you have installed google-chrome, you might recently have gotten the message:
    google-chrome cannot be run as root.

    Very annoying.

    Now here's the antidote:

    First, switch off Xorg access control:
    Code:
    xhost +
    Now start google chrome as normal user "anonymous"
    Code:
    sudo -i -u anonymous /opt/google/chrome/chrome
    When done browsing, re-enable Xorg access control:
    Code:
    xhost -
    In a world without walls and fences, who needs Windows and Gates?
    Linux is like a wigwam.... no Gates, no Windows but Apache inside!
    http://www.debianadmin.com
    apt-get install libstdc++6-4.3-doc

  2. #2
    Join Date
    Feb 2009
    Beans
    1

    Lightbulb Re: Howto run google-chrome as root

    Just want to add a permanent solution to the problem:

    1. Open google-chrome located in /usr/bin with 'gedit', 'kate' or your favorite text editor.

    Code:
    gedit /usr/bin google-chrome
    2. Add "--user-data-dir" (without the quotes) at the very end of the file. Mine looks like this:

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

    3. Save, close and voilą, you're done. Enjoy your favorite browser.

  3. #3
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,744

    Re: Howto run google-chrome as root

    Quote Originally Posted by id2578 View Post
    Just want to add a permanent solution to the problem:

    1. Open google-chrome located in /usr/bin with 'gedit', 'kate' or your favorite text editor.

    Code:
    gedit /usr/bin google-chrome
    2. Add "--user-data-dir" (without the quotes) at the very end of the file. Mine looks like this:

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

    3. Save, close and voilą, you're done. Enjoy your favorite browser.
    You should never run a web browser as root, certainly not permanently.

    If there is a need to run it as root then do it for the given instance not a permanent fixture.

    It is ill advised to browse the internet as root.

    Cheers
    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  4. #4
    Join Date
    Jan 2012
    Beans
    5

    Re: Howto run google-chrome as root

    What would be the preferred (safe) way to operate in an environment where root is the only user?

  5. #5
    Join Date
    Feb 2008
    Location
    readlink("/proc/self/exe"
    Beans
    1,120
    Distro
    Ubuntu Development Release

    Wink Re: Howto run google-chrome as root

    Quote Originally Posted by Browncoyote View Post
    What would be the preferred (safe) way to operate in an environment where root is the only user?
    Quite simple:
    Open the google-chrome binary, located at
    Code:
    /opt/google/chrome/chrome
    in a hex editor (make a backup-copy before).

    Now find the string "geteuid" and replace it with "getppid".
    Done !

    Make a script for this, and trigger script execution every time google-chrome is updated
    In a world without walls and fences, who needs Windows and Gates?
    Linux is like a wigwam.... no Gates, no Windows but Apache inside!
    http://www.debianadmin.com
    apt-get install libstdc++6-4.3-doc

  6. #6
    Join Date
    Jun 2011
    Location
    The Shadow Gallery
    Beans
    6,744

    Re: Howto run google-chrome as root

    Quote Originally Posted by WitchCraft View Post
    Quite simple:
    Open the google-chrome binary, located at
    Code:
    /opt/google/chrome/chrome
    in a hex editor (make a backup-copy before).

    Now find the string "geteuid" and replace it with "getppid".
    Done !

    Make a script for this, and trigger script execution every time google-chrome is updated
    Well as said before it shouldnt be run as root.

    However if you need to there is no need to hex edit which wont work for all versions, no need to script or edit config files, you only need to append a command to the launcher.

    If you use icons to launch then append the following the to the command in the launcher

    Code:
    --user-data-dir
    or add it to the command from terminal such as

    Code:
    google-chrome --user-data-dir
    example the properties of the launcher command is as follows

    Code:
    /opt/google/chrome/google-chrome %U
    just change it to be

    Code:
    /opt/google/chrome/google-chrome –user-data-dir %U
    and thats it.

    Cheers
    Backtrack - Giving machine guns to monkeys since 2006
    Kali-Linux - Adding a grenade launcher to the machine guns since 2013

  7. #7
    Join Date
    Feb 2013
    Beans
    1

    Re: Howto run google-chrome as root

    Thanks.

  8. #8

    Re: Howto run google-chrome as root

    Closed. Necromancing.
    Learning is not attained by chance, it must be sought for with ardor and attended to with diligence. Abigail Adams ( 1744 - 1818 ), 1780;

    My blog Poetry and More Free Ubuntu Magazine

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •