Off-Topic > Off-Topic - Tiny Tux's Corner
[SOLVED] Require password for sudo command ?
Rich:
Hi Lee
If I do:
--- Code: ---sudo su
export EDITOR=editor
visudo
--- End code ---
it opens sudoers using editor.
Rich:
Hi Lee
--- Quote ---No Luck - it looks like w/o the $EDITOR support compiled in it doesn't honor that.
--- End quote ---
From:
http://www.sudo.ws/visudo.man.html
--- Quote ---There is a hard-coded list of one or more editors that visudo will use set at compile-time that may be overridden via the editor sudoers Default variable. This list defaults to vi. Normally, visudo does not honor the VISUAL or EDITOR environment variables unless they contain an editor in the aforementioned editors list. However, if visudo is configured with the --with-env-editor option or the env_editor Default variable is set in sudoers, visudo will use any the editor defines by VISUAL or EDITOR. Note that this can be a security hole since it allows the user to execute any program they wish simply by setting VISUAL or EDITOR.
--- End quote ---
remus:
Not sure if this is worth the calories burnt in brain effort, but the insults command appended to the Defaults line does not appear to be working, should I assume that its been left out of the frugal nature of microcore ?
--- Code: ---#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
# Custom Defaults
Defaults timestamp_timeout=2
Defaults passwd_timeout=1, insults
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
tc ALL=(ALL) ALL
--- End code ---
tinypoodle:
--- Quote from: remus on May 22, 2013, 10:48:13 PM ---Not sure if this is worth the calories burnt in brain effort, but the insults command
--- End quote ---
Personally I have never heard of any such command on any system, but just guessing now, does it perhaps feature quotes of Linus related to udev, systemd et al?
Rich:
Here's a straightforward way to get visudo to use a different editor. Add a Defaults statement to sudoers like this:
--- Code: ---Defaults editor=/usr/bin/editor
--- End code ---
To use another editor, replace /usr/bin/editor with the name and path to your editor.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version