In general, to perform any operation that requires root privileges, I like to use sudo, which gives root privileges temporarily. So here is how to add yourself to the sudoers group:
su
Then you type the root password (which will not appear as you type it).
Once logged as root, type:
apt-get install sudo
to make sure the required package is installed.
Then configure it:
visudo
At the end of the file, you will see:
# User privilege specification
root ALL=(ALL) ALL
just add, at the end a line like that:
mastah ALL=(ALL) ALL
mastah being my username.
Save the file, and you are done. You can log off as root:
exit










8 comments:
thank you (great how-to's to be found at your site:-)
so I edited sudoers file by adding an extra line as described in the howto.
However, I am a bit at a loss understanding the sense of it. I mean, I was always able to change to root just by typing su and then my root password.
I mean, does doing this add an extra level of comfort working with sudo? If yes, it does not come obvious from the text of the howto.
It would really be appreciated if the author could explain in a bit more detail what is the use of adding the extra line to sudoers file. My email is sea.fish69@gmail.com
Hello,
The sudo application basically allows your user to run commands with root privileges.
A great, more thorough explanation can be found here, on Wikipedia.
Thanks for your comment,
Hugues
Hello! I read this article! Big thanks to author, very interesting. Write more.
It would be nice to add that this just the most basic setup of sudo, not really secure.
This config just grants privileges to execute anything in the box.
In more complex enviroments, I think there's a way to configure sudo to let users execute only certain commands.
How do you save the sudoers file? Thank you.
sudo can step up security in a number of ways. Here is one.
Passwords are possibly the "weakest link" of system security; to be strong they must be complex and long, to be usable they should be short and memorable.
Configuring sudo in this way will allow you to set a more secure root password. Because you don't enter it all the time you don't care how long it is. When brute-forcing (guessing until correct) your root password, the only thing an attacker has to guess is your password--not the user id. Having to guess both results in astronomically slimmer chances your account will be compromised.
But in the long run, lets face it, there are other ways of getting your user id (eg. mastah).
sudo has other benefits. Instead of working with root privileges, you only escalate privileges on the command you run.
really helpful. thanks
Post a Comment