View Single Post
Posts: 373 | Thanked: 56 times | Joined on Dec 2005 @ Ottawa, ON
#10
Originally Posted by polyesterangst View Post
sudo gainroot only gives you a shell of root, since you are not in the main directory, but rather the user directory. So it doesn't do the same.
'sudo gainroot' (once you've installed the becomeroot package or enabled the R&D mode) is like 'su' without the '-' ; You gain root privileges but don't load the profile of root.

You can likely just 'su -' once you've gainroot'ed if you really need those environment variables set. If you want to login as root with 'su -' or via ssh (once you've installed an sshd), set the root password with passwd.

However, that is generally discouraged since logging on as an unprivilaged user and then exscalating your privilage when needed is better than just diving in and doing everything as root. Not having a root password forces you to do things the "right" way.