My Oracle Support Banner

OCI : How to Fix Syntax Error/Issues on /etc/sudoers File in OL (Doc ID 2408900.1)

Last updated on APRIL 17, 2023

Applies to:

Oracle Linux Cloud Service - Version Oracle Linux 5.0 and later
Oracle Cloud Infrastructure - Version N/A and later
Linux x86
Linux x86-64


For some reason, we may have to make some changes in the /etc/sudoers file, for e.g to add a sudo users.

But after making the changes on the file, it is possible that the user cannot login and get the errors like below:

$ sudo su -
>>> /etc/sudoers: syntax error near line 93 <<<
sudo: parse error in /etc/sudoers near line 93
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

The errors might also be different. But this document aims at how to fix the sudoers file on the OCI instances.

There is another method to fix the issue using OCI serial console . Please refer section "To boot into maintenance mode" and "To edit the system configuration files" which explains how to enter maintenance mode and there you can revert the changes you made in /etc/sudoers file.

This article explains on how to achieve the same using another method. Especially useful if serial console is not working due to some reason.


To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.