OCI : How to Fix Syntax Error/Issues on /etc/sudoers File in OL
(Doc ID 2408900.1)
Last updated on SEPTEMBER 13, 2021
Applies to:Oracle Linux Cloud Service - Version Oracle Linux 5.0 and later
Oracle Cloud Infrastructure - Version N/A and later
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 https://docs.cloud.oracle.com/iaas/Content/Compute/References/serialconsole.htm . 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