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. mysql获取字段信息

    SELECT TABLE_SCHEMA AS `databaseName`, TABLE_NAME AS `tableName`, COLUMN_NAME AS `columnName`, DATA_ ...

  2. python面试的100题(9)

    17.python如何实现单例模式?请写出两种实现方式? 第一种方法:使用装饰器 def singleton(cls): instances = {} def wrapper(*args, **kwa ...

  3. mongo 改数据库名称

    用命令 db.copyDatabase('old_name', 'new_name') 可以备份出一个新的数据库. 然后  use old_name 并db.dropDatabase() 即可删除旧的 ...

  4. 初识Java爬虫之Jsoup,提供参考代码

    本文主要分享的是关于Java爬虫技术其中一个方式   ==>  Jsoup 1.Jsoup简介 推开技术大门,爬虫技术琳琅满目,而今天要分享的Jsoup是一款Java的HTML解析神器,,可直接 ...

  5. audio mixer

    https://blog.csdn.net/jeffasd/article/details/77155187 https://blog.csdn.net/jeffasd/article/details ...

  6. C#中数据类型char*,const char*和string的三者转换

    C#中数据类型char*,const char*和string的三者转换: . const char* 和string 转换 () const char*转换为 string,直接赋值即可. EX: ...

  7. C++之Boost准标准库配置

    下载安装 进入官网下载地址:https://www.boost.org/users/download/ 本教程直接下载官方已编译库,不涉及源代码手动编译 点击官方编号好的链接,然后进入一个下载地址:h ...

  8. Lenet 神经网络-实现篇(2)

    Lenet 神经网络在 Mnist 数据集上的实现,主要分为三个部分:前向传播过程(mnist_lenet5_forward.py).反向传播过程(mnist_lenet5_backword.py). ...

  9. git 本地回滚与远程库回滚

    不说废话,开始: 一.本地回滚: git reset --hard commit-id //回滚到commit-id 二.远程回滚操作分3步:①将本地分支退回到某个commit    ②删除远程分支  ...

  10. 前端——语言——Core JS——《The good part》读书笔记——第一章节(Good Parts)

    本章是引言,有四个小节,具体内容如下: 第一小节 第一小节介绍作者的观点,作者编写本书的目的. 原文:I discovered that I could be a better programmer ...