Originally Posted by
sisco311
`sudo -i' is the recommended command to start a root shell in Ubuntu. Just like in other distributions where the root account is enabled, the recommended command for starting a root shell is `su -', `su -l' or `su --login'.
yeah i remember with debian i used su and bash to become root.
Originally Posted by
coffeecat
The use of sudo su (or sudo -i - better) is descibed in the link I posted in post #2. It's worth reading if you're using Ubuntu.
I guess you're thinking of those occasions where you are using a bash redirect, such as:
Code:
sudo echo string > /path/to/file
... which fails. All you need is the use of a pipe and tee, as in:
Code:
echo string | sudo tee /path/to/file
No need for sudo su-ing all over the place.
well i don't remember exactly as it happened a long time ago, but i think it had something to do with setting some sysctl parameters, or echoing stuff in /sys/*.
in the link you posted earlier i've found this link http://ubuntuforums.org/showpost.php...26&postcount=4 which contains this table:
Code:
corrupted by user's
HOME=/root uses root's PATH env vars
sudo -i Y Y[2] N
sudo -s N Y[2] Y
sudo bash N Y[2] Y
sudo su Y N[1] Y
so since $PATH is the same under both user and root (in my case at least) i guess the main advantage of sudo -i over sudo su is about enviroment variables...?
thank you all for your advices.
Bookmarks