How to handle special characters in /etc/sudoers file ?
Issue
-
/etc/sudoers
file does not accept special characters such as:!
,=
,:
,,
,(
,)
,\
in/etc/sudoers
configuration file. -
For example, below
/etc/sudoers
configuration entry gives a syntax error while modifying it withvisudo
admin ALL=(ALL) NOPASSWD: /path/to/app IsAlive module\:All instance:iv1
-
Expected error in case of special character usage without escape.
visudo >>> /etc/sudoers: syntax error near line 114 <<< What now? Options are: (e)dit sudoers file again e(x)it without saving changes to sudoers file (Q)uit and save changes to sudoers file (DANGER!)
Environment
- Red Hat Enterprise Linux (RHEL): All supported versions.
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.