0

I discovered that using the visudo command in Ubuntu results in opening Nano. This is not the behaviour I expect or that see when using CentOS or Darwin.

I see that this topic is discussed here and there but I do not an answer to the question I am posing here...

Is it safe to edit the sudoers files when using nano invoked by visudo? That is to ask if visudo is doing the syntax checking in another editor?

Thanks in advance,

Cameron.

1 Answers1

0

visudo, like many other programs, uses the Debian alternatives system to determine which one of the installed programs that have similar functionality (eg. editors) is the default one that should be used.

You can display what program is currently used as default editor by using the command:

update-alternatives --display editor

It will display the currently selected default editor and possible alternative options. To select one of the alternative options as default, use the command:

sudo update-alternatives --config editor

You will be asked which one of the available programs to choose.

As it was already mentioned in the comments, syntax check works independently of which editor is used by the visudo command, as it is performed by the visudo command itself and not by the editor.

raj
  • 11,409