PDA

View Full Version : fc5 - sudo - su



AppsDev
24th March 2006, 04:29 PM
Good Day All . . .

I installed fc5 twice because of a reiserfs issue.

Both installs have the same problem. I can su but I cannot sudo.

su accepts the root password but sudo does not. sudo gives me three tries and then quits. The syntax is correct for sudo but no access.

Minor issue but annoying!

Any help?

baschti
24th March 2006, 04:37 PM
hi,
try: man sudo
you have to edit the /etc/sudoers file first
and sudo does not require the root password but the user password

AppsDev
24th March 2006, 04:48 PM
Thanks for the reply.

I did that but the file contains:

# User privilege specification
root ALL=(ALL) ALL

I assume this to mean that the root user is included.

What am I doing wrong?

sway
24th March 2006, 04:53 PM
Eh, you must specify rules for your user, not for root...

red_dungeon
24th March 2006, 05:06 PM
Example:

If you wanna allow EXAMPLE_USER to restart your webserver (without a root password)

Type in



EXAMPLE_USER ALL=NOPASSWD:/etc/init.d/httpd restart


after that



EXAMPLE_USER$ sudo /etc/init.d/httpd restart


should work :-)

bob
24th March 2006, 05:22 PM
Here's a short thread that might help: http://forums.fedoraforum.org/showthread.php?t=85830

AppsDev
24th March 2006, 08:51 PM
Good Day All . . .

Thank You for the replies.

I think I have solved the problem with all your help.

What I needed was a sudo option to run root stuff. I am not sufficiently knowledgeable to edit config files but I am good with examples. In the below example, I would never have thought about adding the percentage sign to the username since the root name below in the sudoers file omits it.

Sorry, just'ol'bob and red_dungeon, I found this before you posted. I am getting too old for this new . . .

I use removeable hard drives so I looked at my backup of SUSE 10.0's /etc/sudoers and I compared the fc5 and the backup. SUSE 10.0 has an entry

Defaults targetpw # ask for the password of the target user i.e. root
%username ALL=(ALL) ALL # WARNING! Only use this together with 'Defaults targetpw'!

I added the code to the fc5 file and it worked! I'm happy.

Please consider this thread satisfactorily closed and I Thank You all for your help.