visudo config!


Forum: Apps
Topic: visudo config!
started by: antonino

Posted by antonino on Sep. 22 2006,07:57
Hi all,

After having edited sudoers with vi I found out this is a big nono, it should be doen with visudo!
Alas sudo visudo tells me
Code Sample
visudo: no editor found (editor path = /usr/bin/editor)

Does anyone know where to find the visudo config?

Thanks in advance!

Posted by mikshaw on Sep. 22 2006,13:37
ln -s vi /usr/bin/editor
If you put editor in a different directory, use the path to vi

You might instead be able to set the editor with the EDITOR environment variable.

Posted by antonino on Sep. 23 2006,09:54
Hmm, I think I am missing something...
I don't have the foggiest where visudo is 'told' to look at /usr/bin/editor (vi resides in the same dir /usr/bin).
I put
Code Sample
EDITOR=vi
export EDITOR

in /ect/bashrc, but alas no change...

Posted by mikshaw on Sep. 23 2006,11:21
Yeah, the EDITOR variable was just a guess.  I've never used visudo in DSL, and my other systems were already set up to use it properly.

Anyway, this is from the visudo man page:
Quote
      There is a hard-coded list of editors that visudo will use set at
      compile-time that may be overridden via the editor sudoers Default
      variable.  This list defaults to the path to vi(1) on your system,
      as determined by the configure script.  Normally, visudo does not
      honor the EDITOR or VISUAL environment variables unless they contain
      an editor in the aforementioned editors list.  However, if visudo is
      configured with the --with-enveditor flag or the enveditor Default
      variable is set in sudoers, visudo will use any the editor defines
      by EDITOR or VISUAL.  Note that this can be a security hole since it
      allows the user to execute any program they wish simply by setting
      EDITOR or VISUAL.

I have no idea how visudo was compiled for Knoppix/DSL, but my guess is support for the EDITOR variable was not enabled.  In any case, visudo obviously is looking for an application called "/usr/bin/editor", so making the symlink i mentioned in the first post should work:
ln -s vi /usr/bin/editor

Posted by antonino on Sep. 23 2006,15:20
EXCUSE ME! I misread your symlink command...
I put it in /etc/bashrc and everything works fine.

Thanks ever so much.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.