Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I reinstalled my Linux and set the root password. But now I can't login to root. I can only run updates by password setted and do similar task but sudo is not working.

What's the problem?

share|improve this question
    
What does sudo tell you when you try and use it? –  Majenko Mar 18 '11 at 20:26
    
that I'm not sudoer. –  oneat Mar 18 '11 at 20:30
add comment

2 Answers

up vote 1 down vote accepted

Fedora does not configure sudo by default. Instead the default behavior is to obtain a root shell with the su command. The rough equivalent to sudo is to use the -c argument to make it run a command. For instance, to update your system you'd run:

su -c 'yum update'

As Matt Jenkins indicated, you can configure sudo to work on Fedora. Follow his instructions for discovering the syntax of the sudoers file and then run this command to edit it:

su -c visudo

To add yourself to the admin group more easily, without modifying /etc/groups directly, just run this command:

su -c 'usermod -aG admin [username]'
share|improve this answer
add comment

This is caused by one of two things:

  1. You are not in the correct group to use sudo
  2. You have not got the sudo configuration file set up right.

type:

$ man sudoers

and read all about setting up the sudoers file.

Editing of the sudoers file is done through visudo.

I have in my sudoers file:

# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL

and I am a member of the admin group (in /etc/group). This lets me sudo to root without having to enter a password.

share|improve this answer
    
Hey! I can't perform this cause I can't use sudo or login to root, but I know root's password (which is only working on upgrades etc) –  oneat Mar 18 '11 at 20:36
    
So boot into single user mode then. –  Majenko Mar 18 '11 at 21:55
    
HOW? I can't get to GRUB pressing shift all booting long –  oneat Mar 18 '11 at 22:19
    
Then the final option - boot of a linux cd, mount the root filesystem, and edit the files you need to edit. –  Majenko Mar 18 '11 at 22:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.