Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

As full disclosure, no I did not use visudo. Had forgotten such a utility existed. Lesson learned.

I was trying to edit my /etc/sudoers to allow password-less command execution for a specific script that will run on cron. I tried to add the 'visiblepw' defaults entry, but apparently mucked it up.

The box is running openSUSE 11.1, on kernel 2.6.27.7-9. It's throwing the following error on any sudo command:

sudo: unknown defaults entry `visiblepw' referenced near line 22
sudo: parse error in /etc/sudoers near line 21

What are my options for fixing the sudoers file? The root password on file does not appear to be working.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Since your root password does not work, what you'll have to do is to get the distro install CD and

 1. reboot in rescue mode; 
 2. mount the root drive R/W;
 3. clear the root password (a temp step) from the MOUNTED ROOT /etc/shadow; 
 4. reboot;
 5. login as root from the console
 6. immediately set a new root password using passwd
 7. then attempt to reedit the sudoers file.
share|improve this answer
    
if I'm in rescue mode, can I not edit the sudoers from there? (but may as well clear /etc/shadow while I'm there?) –  Matt Dec 3 '12 at 20:29
    
sure, figured the least amount of time in the rescue mode the better. Especially if you were a production system. –  mdpc Dec 3 '12 at 20:30
    
when I clear the root password from /etc/shadow, that sets it to blank? (no password?) –  Matt Dec 3 '12 at 20:52
    
This is correct-a-mundo! –  mdpc Dec 3 '12 at 20:54
    
Why do you think your root password doesn't work? If your only evidence is that you can't log in with it you might have simply set the box to not allow remote root login. On some systems you can SSH from your low-privilege account to the box (via localhost) and then use the root password. Worth trying. –  Mark Dec 3 '12 at 22:36

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.