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?

  • 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

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]'
|improve this answer|||||

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.


$ 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

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

|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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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