SUDO_EDITOR

Written by Zak Zhu

参考

SUDO_EDITOR

man visudo

...

There are two sudoers settings that determine which editor visudo will run.

editor

​ A colon (‘:’) separated list of editors allowed to be used with visudo. visudo will choose the editor that matches the user's SUDO_EDITOR, VISUAL or EDITOR environment variable if possible, or the first editor in the list that exists and is executable. Note that the SUDO_EDITOR, VISUAL and EDITOR environment variables are not preserved by default when the env_reset sudoers option is enabled. The default editor path is /bin/vi which can be set at compile time via the --with-editor configure option.

env_editor

​ If set, visudo will use the value of the SUDO_EDITOR, VISUAL or EDITOR environment variables before falling back on the default editor list. Note that this may create a security hole as it allows the user to run any arbitrary command as root without logging. A safer alternative is to place a colon-separated list of editors in the editor variable. visudo will then only use SUDO_EDITOR, VISUAL or EDITOR if they match a value specified in editor. If the env_reset flag is enabled, the SUDO_EDITOR, VISUAL and/or EDITOR environment variables must be present in the env_keep list for the env_editor flag to function when visudo is invoked via sudo. The default value is on, which can be set at compile time via the --with-env-editor configure option.

...

visudo的默认editor是vi, 下面把editor修改为vim, 这样visudo就支持字体彩色显示

vim /etc/profile.d/SUDO_EDITOR.sh

SUDO_EDITOR="vim"
export SUDO_EDITOR

SUDO_EDITOR的更多相关文章

  1. Linux基础命令---sudo

    sudo sudo允许用户以超级用户或安全策略指定的另一个用户的身份执行命令.Sudo支持安全策略插件和输入/输出日志的插件.第三方可以开发和分发自己的策略和I/O日志插件,以便与sudo前端无缝地工 ...

  2. Linux Hardening Guide

    文章转载自:https://madaidans-insecurities.github.io/guides/linux-hardening.html 1. Choosing the right Lin ...

随机推荐

  1. bitlocker对磁盘进行加密解密

    1,bitlocker是什么? BitLocker即Windows BitLocker驱动器加密.是微软在Windows Vista中新增的一种数据保护功能.使用BitLocker可以加密磁盘.主要用 ...

  2. php核心技术与最佳实践 --- 错误与异常

    <?php /*php error*/ /* * 异常和错误的概念不一样 * 在PHP里,遇到任何自身错误都会触发一个错误,而不是抛出异常(对于一些情况,会同时抛出异常和错误) * 异常处理机制 ...

  3. js面向对象的程序设计 --- 上篇(理解对象)

    前言 ECMAScript中没有类的概念,因此它们的对象与基于类的语言中的对象有所不同. ECMA-262把对象定义为:"无序的集合属性,其属性可以包含基本值,对象或者函数".正因 ...

  4. Git 时光穿梭机

    git log 提交日志 git reflog 命令日志 git status 查看状态 管理修改 git diff 工作区与暂存区 git diff master 工作区与版本库 git diff ...

  5. c# DPI SCale

    public class Screen { /// Primary Screen #region Win32 API [DllImport("user32.dll")] stati ...

  6. SpringBoot与动态多数据源切换

      本文简单的介绍一下基于SpringBoot框架动态多数据源切换的实现,采用主从配置的方式,配置master.slave两个数据库. 一.配置主从数据库 spring: datasource: ty ...

  7. 在Linux系统下安装jdk并配置环境变量

    本文主要介绍的是如何是Linux环境下安装JDK的,因为Linux环境下,很多时候也离不开Java的,下面笔者就和大家一起分享如何jdk1.8的过程吧. 1.安装环境 操作系统:CentOS 07 6 ...

  8. lnmt

    目录 1.nginx安装与配置 1.1安装nginx 1.2nginx安装后的配置 2.mysql安装与配置 2.1安装mysql 2.2mysql配置 3.部署tomcat 3.1java环境安装 ...

  9. 后端工具——Maven——初篇——目录

    目录 Maven的知识体系包括四个部分.Maven的配置文件,Maven命令,Maven生命周期,Maven插件.在介绍Maven之前,首先需要介绍如何安装Maven. 安装:介绍Maven在Linu ...

  10. 每天进步一点点------Allegro 群组布线

    执行Route->connect命令,设置好控制面板中的内容.然后设置同时走线的GROUP包含哪些网络,有两种方法.第一种方法,如果几个网络是紧邻的,可以直接框选,选中的网络就会被包含在GROU ...