Linux: Broken sudoers file in Ubuntu

I’ve done this twice now, sometimes lessons need repeating. If you are going to edit /etc/sudoers in Ubuntu then set a root password or you risk locking yourself out.

If you edit the sudoers file and the syntax is incorrect then the system can no longer read the sudoers file. Now you can’t fix the file because

sudo vi /etc/sudoers

returns an error.

You need to reboot, holding shift before the grub menu, and choose recovery mode. Now go to the command line as root, mount the filesystem as read/write and give yourself permission to edit the sudoers file:

mount -n -o remount,rw /
chmod u+x /etc/sudoers

Now:

vi /etc/sudoers

and fix that mistake.

Really though .. if you had set a secure root password you could have avoided the pain with

su -

5 Replies to “Linux: Broken sudoers file in Ubuntu”

  1. [7621]bet1777 Official Login | বিকাশ দিয়ে অনলাইনে ক্যাসিনো গেম খেলুন,bet1777 অ্যাপ ডাউনলোড করে সহজেই স্লট গেম খেলার নিয়ম জানুন। বিকাশ দিয়ে নিরাপদ লেনদেনের মাধ্যমে সেরা ক্যাসিনো অভিজ্ঞতার জন্য আজই জয়েন করুন। visit: bet1777

  2. [4455]Exsototo: Login Resmi Link Alternatif & Slot Gacor Terpercaya,Exsototo menyediakan akses login resmi dan link alternatif terbaru. Temukan berbagai slot gacor hari ini dan cara deposit dana mudah. Daftar sekarang juga! visit: exsototo

  3. [5911]fortislots লগইন ও অ্যাপ ডাউনলোড | বিকাশ অনলাইন ক্যাসিনো,fortislots লগইন করুন এবং সেরা অনলাইন স্লট গেম উপভোগ করুন। বিকাশ দিয়ে অনলাইন ক্যাসিনো পেমেন্ট ও রিয়েল মানি ক্যাসিনো বোনাস পেতে আজই অ্যাপ ডাউনলোড করুন। visit: fortislots

Leave a Reply

Your email address will not be published. Required fields are marked *