visudo: sudoers file busy, try again later

Quick note on how to un-lock yourself from a failed visudo session.

f you’ve accidentally locked yourself out either via an accidental crtl-c or system restart and you were in the middle of editing /etc/sudoers via visudo there are two steps to take to restore it to a normal state (aka un-lock yourself)

I’ve done the following on an Ubuntu GNU/Linux system — but I’m assuming it is fairly cross-platform.

1) rm /etc/sudoers.tmp — this is the lockfile visudo creates

2) chmod u+x /etc/sudoers — visudo marks /etc/sudoers as read-only.

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Reddit