PDA

View Full Version : I cant use sudo



RHCA
01-17-2007, 08:40 AM
Hello and Thanx again I have installed the DVD on my HD and it works great dualbotting with win xp, I had to use sudo yesterday and when i try to use sudo in the command line it says RHCA is not in the sudoers list this incident will be reported. RHCA is my username and hostname any ideas?

nohype
01-17-2007, 12:12 PM
Hi RHCA,

I answered your question recently. As root-user you may edit your sudoers-file. That is, please type in at your command-line-prompt:

su -

Then, for the needed change, please look at this thread:

"Super User at Knoppix 5.1.1 HD-installed"

-nohype

RHCA
01-18-2007, 05:15 PM
I dont understand so much what you said I am a little new to linux and i would like you to explain it more

nohype
01-18-2007, 07:35 PM
Hi RHCA,

you may want to edit your "sudoers" file. How to do that:

login as "root" in a console window by typing

$ su -

at the prompt.

Then you can edit (with any text-editor) the text-file "/etc/sudoers" by changing 1 line (by commenting out the line beginning with "knoppix" by a leading "#" - without using the quotation marks) and adding a new line for user "RHCA" - that's YOU - expressing the rights of "RHCA" for executing privileged commands by "sudo".
_______________________
# /etc/sudoers
...
...
# knoppix ALL=NOPASSWD: ALL
RHCA ALL=NOPASSWD: ALL
_______________________

Hth.

-nohype

RHCA
01-19-2007, 05:16 PM
Hello I have already edited the sudoers file bit now when i try to use sudo it says that it is on 660 and it should be on 440 or something like this. Have got any ideas?

nohype
01-19-2007, 06:01 PM
...
sudoers file ... should be on 440 or something like this.
...


This is correct!
Explanation: sudo is the "owner" of "/etc/sudoers" and allows to the owner (=itself) and to group members only read-access-rights to "/etc/sudoers" when executing sudo and forbids all other access-rights.

FYI: file-access-rights are coded like this:

0400 Allow read by owner.
0200 Allow write by owner.
0020 Allow write by group members.
0040 Allow read by group members.

Adding these codes means that access-rights are granted for the individual rights expressed by the unique summands.

So 0660=660 is the unique sum of 0200,0400,0020,0040 with the obvious rights.
But only 0440=440 being the (unique!) sum of 0400 and 0040 are allowed.

So, change these access-rights accordingly with the chmod-command in root-user mode:

$ su -

and then

# chmod 440 /etc/sudoers.

That's it!

Hth
-nohype

RHCA
01-19-2007, 06:30 PM
Hey Thanx It works great

onemyndseye
01-26-2007, 12:55 PM
excellent quick explaination of file permissions nohype!!

Take care,
-Justin
One Mynds Eye