Get sudo working on Fedora 7

A handy feature of Fedora 7 (and most Linux’s) is to be able to run a command as admin (root). In the past I’ve done this by using su but it’s not really a good idea for security reasons.
Using sudo will just run the one command as root, so it’s a lot safer, plus you give your own password – not roots. Here’s how I set it up.

Open a terminal session (look in the menu under Applications -> System Tools).
Then type:

[craig@localhost ~]$ su
Password:
[root@localhost craig]# /usr/sbin/visudo

You will now be in a vi-like editor.
Find the line like root ALL=(ALL) ALL and make a copy of that line just below it.
Substitute your user name for root.
Type [esc]:wq (that’s the escape key followed by colon then wq then enter)

You will now be back at roots command prompt, type exit to return to your own command prompt:
[root@localhost craig]# exit
[craig@localhost ~]$ whoami
craig
[craig@localhost ~]$

As you can see above, the whoami command prints the userid is use.
You can now use this to test out your newly configured sudo!

[craig@localhost ~]$ whoami
craig
[craig@localhost ~]$ sudo whoami
Password:
root
[craig@localhost ~]$

Note that the password entered is your own – not roots!

This entry was posted in Linux. Bookmark the permalink.

One Response to Get sudo working on Fedora 7

  1. Pingback: Shady Goings On » If you forgot your root password on Linux…

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>