How Should You Modify the sudoers File?

Problem scenario
You want to modify the /etc/sudoers file. What should you do?

You may want to back it up. Never modify it with vi, vim or gedit. Use "sudo visudo". Page 433 of A Practical Guide to Fedora and RedHat Enterprise Linux recommends you always use sudo visudo. If you accidentally corrupt the file when modifying /etc/sudoers manually, you can be prevented from using sudo again. Your Linux system may not be recoverable if you cannot use sudo again. There are ways to fix it, but be warned you should always use "sudo visudo" to modify /etc/sudoers.

Leave a comment

Your email address will not be published.