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. vue插槽的使用

    一.插槽的基本使用 二.具名插槽的使用 三.编译作用域的例子 四.作用域插槽 一.插槽的基本使用     1.插槽的基本使用<slot></slot>     2.插槽的默认值 ...

  2. Makefile文件(DE1-soc软件实验”hello_word")

    DE1-soc软件实验”hello_word"中,hello_word此程序很好理解,那Makefile文件又如何理解呢? 所要完成的Makefile 文件描述了整个工程的编译.连接等规则. ...

  3. 使用 NuGet 包管理器在 Visual Studio 中安装和管理包

    https://docs.microsoft.com/zh-cn/nuget/consume-packages/install-use-packages-visual-studio 通过 Window ...

  4. 请求响应状态status为canceled

    发出ajax请求之后 发现status状态是canceled 1. 和form冲突 我的提交代码是这样的 $.ajax({ //几个参数需要注意一下 type: "POST",// ...

  5. Day4 注解 泛型

    注解是什么 注释是绑定到程序源代码元素的元数据,对它们运行的​​代码的操作没有影响. https://blog.csdn.net/SDDDLLL/article/details/93509699 他们 ...

  6. 滑雪(dfs+dp)

    滑雪 Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 113903   Accepted: 43478 Description ...

  7. spring cloud config 连接GitHub访问 报错 Cannot clone or checkout repository

    原因是建立仓库的时候将仓库私有化了,将仓库公有 或者 设置账号密码即可!

  8. SQLAlchemy -高级查询

    查询 # -*- coding: utf-8 -*-   from sqlalchemy.orm import sessionmaker   from SQLAlchemy.create import ...

  9. js 判断数组中是否包含某个元素

    vuex中结合使用v-if: 链接:https://www.cnblogs.com/hao-1234-1234/p/10980102.html

  10. iOS 10.3+ 动态修改 App 图标

    支持系统: iOS 10.3+ tvOS 10.2+ Apple 官方文档 官方 API: @interface UIApplication (UIAlternateApplicationIcons) ...