Installing and Configuring sudo on Gentoo
It is not always good to use root constantly, for this sudo exists. To install it simply run the command below, -a
is optional which is the same as --ask
, Portage asks you if you want to continue and also shows the package(s) that will be compiled.
su
emerge -a sudo
After that fill in the field [NAME_YOUR_USER] with your user number
export my_user="[NAME_YOUR_USER]"
Then, run the command below
sed -i "/^root ALL=(ALL) ALL$/a ${my_user} ALL=(ALL) ALL" /etc/sudoers
The first time you use sudo this message will appear:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
Password: ## (Enter the user password, not root!)
Now just use sudo with the password of the user you chose!
More information: https://wiki.gentoo.org/wiki/Sudo