HOW TO install sudo

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

HOW TO install sudo

Postby viking60 » 03 Sep 2010, 12:50

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
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8483
Joined: 14 Mar 2010, 20:29
Contact:

Re: HOW TO install sudo

Postby dedanna1029 » 03 Sep 2010, 17:20

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... ???
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

Re: HOW TO install sudo

Postby viking60 » 03 Sep 2010, 19:31

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)
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8483
Joined: 14 Mar 2010, 20:29
Contact:

Re: HOW TO install sudo

Postby dedanna1029 » 03 Sep 2010, 21:29

Ah, so that's why it never worked for me before. Thanks!
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

Re: HOW TO install sudo

Postby viking60 » 03 Sep 2010, 22:01

:greetings You are not the first, for sure! Lemme know if it works for ya :tux5:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

Re: HOW TO install sudo

Postby viking60 » 04 Sep 2010, 18:41

I guess you did not get it to work :?: So I made a video that says more than a 1000 words :whistle:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8483
Joined: 14 Mar 2010, 20:29
Contact:

Re: HOW TO install sudo

Postby dedanna1029 » 04 Sep 2010, 21:03

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. :)
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

Re: HOW TO install sudo

Postby viking60 » 04 Sep 2010, 21:27

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:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8483
Joined: 14 Mar 2010, 20:29
Contact:

Re: HOW TO install sudo

Postby dedanna1029 » 04 Sep 2010, 22:57

LMAOOOOOOOOOO
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

Re: HOW TO install sudo

Postby viking60 » 14 Sep 2010, 18:46

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:
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9280
Joined: 14 Mar 2010, 16:34

Re: HOW TO install sudo

Postby viking60 » 14 Sep 2010, 22:21

If you still cannot get this to work then this will take care of it:
http://tinyurl.com/2vmkgor
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8483
Joined: 14 Mar 2010, 20:29
Contact:

Re: HOW TO install sudo

Postby dedanna1029 » 15 Sep 2010, 01:31

Thanks! As usual, still have to get there. LOL. Life, I tell ya. :oops:
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html


Return to “Tips & Tricks”