Page 1 of 2

HOW TO install sudo

Posted: 03 Sep 2010, 12:50
by viking60
I often refer to sudo in my tips. If you do not have it installed, you will have to write su and punch your root password.
Install sudo.
To make use of sudo you have to do it via visudo. If you are familiar with vim all you have to do is to type visudo as root in a terminal.
If you are like me you prefere nano as an editor so as root, I do a:
su
password

Code: Select all

EDITOR=nano visudo

Add the following line in the user privilege specification section:
username ALL=(ALL) ALL
In my case that would be:

Code: Select all

viking60  ALL=(ALL) ALL

Punch CTRL+X and say yes to saving the file.
That is it - you can now use sudo.

The data entered in visudo is saved in /etc/sudoers file. DO NOT ATTEMPT TO EDIT IT DIRECTLY :hand: :!: You must use the procedure described above. :T

Re: HOW TO install sudo

Posted: 03 Sep 2010, 17:20
by dedanna1029
viking60 wrote:If you are like me you prefere nano as an editor so as root, I do a:
su
password

Code: Select all

EDITOR=nano visudo

Add the following line in the user privilege specification section:
username ALL=(ALL) ALL
In my case that would be:

Code: Select all

viking60  ALL=(ALL) ALL

Save the file as... ???

Re: HOW TO install sudo

Posted: 03 Sep 2010, 19:31
by viking60
As nothing - just save it!!!
ctrl o enter
It says sudoers.tmp when editing and you shall not change anything.
(so you are saving it as sudoers.tmp - but I do not want to encourage anyone to enter their own creative names -just save it - DO NOT NAME IT)

Re: HOW TO install sudo

Posted: 03 Sep 2010, 21:29
by dedanna1029
Ah, so that's why it never worked for me before. Thanks!

Re: HOW TO install sudo

Posted: 03 Sep 2010, 22:01
by viking60
:greetings You are not the first, for sure! Lemme know if it works for ya :tux5:

Re: HOW TO install sudo

Posted: 04 Sep 2010, 18:41
by viking60
I guess you did not get it to work :?: So I made a video that says more than a 1000 words :whistle:

Re: HOW TO install sudo

Posted: 04 Sep 2010, 21:03
by dedanna1029
Oh, sorry, haven't been there yet.

Been kinda taking some time off from computing on the whole, other than updates. Will do when I can get there. Been busy with other stuff. The video's cool though. Thank you. :)

Re: HOW TO install sudo

Posted: 04 Sep 2010, 21:27
by viking60
I have put some music on it so that you will be able to keep your a... in the same place for 2 min. :mrgreen:

Re: HOW TO install sudo

Posted: 04 Sep 2010, 22:57
by dedanna1029
LMAOOOOOOOOOO

Re: HOW TO install sudo

Posted: 14 Sep 2010, 18:46
by viking60
I just discovered that this method does not work in CENTOS! So here is how it works there.
As root:

Code: Select all

export EDITOR=nano

You can replace nano with gedit if you prefer that one.
Now run:

Code: Select all

/usr/sbin/visudo


And follow the steps above. :tux5:
Again: Do not change file names or create new ones when saving :hand:

Re: HOW TO install sudo

Posted: 14 Sep 2010, 22:21
by viking60
If you still cannot get this to work then this will take care of it:
http://tinyurl.com/2vmkgor

Re: HOW TO install sudo

Posted: 15 Sep 2010, 01:31
by dedanna1029
Thanks! As usual, still have to get there. LOL. Life, I tell ya. :oops: