What would be the preferred (safe) way to operate in an environment where root is the only user?
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
in a hex editor (make a backup-copy before).Code:/opt/google/chrome/chrome
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
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
or add it to the command from terminal such asCode:--user-data-dir
example the properties of the launcher command is as followsCode:google-chrome --user-data-dir
just change it to beCode:/opt/google/chrome/google-chrome %U
and thats it.Code:/opt/google/chrome/google-chrome –user-data-dir %U
Cheers
Backtrack - Giving machine guns to monkeys since 2006
Kali-Linux - Adding a grenade launcher to the machine guns since 2013
I know that it shouldn't be run as root.
But the bottom line is, a normal user just has so few rights, I don't want to bother with that ad infinitum (I'm a programmer, not a sysadmin).
BTW: I have modified the launcher icon a long time ago.
But the problem is, your/this variant doesn't work when you click on a link (e.g. in Thunderbird/E-Mail-Program-Of-Choice) when google-chrome is the default browser, etc. Same problem from instant messengers (pidgin), HTML editors, MonoDevelop (when I want to debug/test a web application on Linux), and wxWidgets C-programs that open helpfiles, as well as the Oracle installer (opens html file) etc.
Furthermore, when run as other user (xhost + variant), there is no sound, and you cannot access the download directory in /root/ (no rights).
So modifying the startup script like
or patching the executable is really the only option (just added that info for information purposes, don't recommend it as it probably has side-effects).Code:exec -a "$0" "$HERE/chrome" "$@" --user-data-dir
The problem with the startup-script variant is that that the startup-script gets replaced with the vanilla variant every time the browser is updated (apt-get dist-upgrade), which is quite often. So you have to replace the new startup script with the old one (dangerous), or parse the new one and add your modifications (also dangerous, not to mention work-intensive), or you can just do a binary search and replace on the first occurrence of "geteuid" with "getppid" with a C program (simple, fast, very effective).
Last edited by WitchCraft; March 31st, 2012 at 11:21 AM.
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
Bookmarks