CentOS, sudo Doesn't Accept root Password, but Logging in as root Works

3

I am new to Linux and I have CentOS running on a dual boot system. I was trying to edit a file requiring root permissions, so I used sudo. I typed the root password and it failed. This happened three times, and the process was ended. I then logged in as root (su) and was able to navigate to the file and make changes as root. Am I missing something? How would I edit the sudoers file such that this password would work? Or is there another way to log in to the sudo group to make these changes? How do I set sudo passwords?

nicorellius

Posted 2010-04-09T18:14:02.883

Reputation: 5 865

Answers

6

Sudo expects you to type in your password, not the password of root. And your account needs to be in the sudoers file.

Marnix A. van Ammers

Posted 2010-04-09T18:14:02.883

Reputation: 1 978

3To make changes to the sudoers file, you should use the visudo command. It's also possible to edit the file directly (once you're root), but then there won't be any automatic syntax checking, so you could end up with an unusable sudoers file. – Marnix A. van Ammers – 2010-04-09T18:25:23.217

OK, great. This is what I just found out. I am in the process of learning how to edit the sudoers file now. Thanks. – nicorellius – 2010-04-09T18:31:17.570