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. MySql5.6表操作

    MySql5.6表操作 数据类型 整型 浮点型 字符类型 日期类型 枚举类型与集合类型 约束条件 Primary key Unique key Not null Foreign key 创建表的完整语 ...

  2. Mysql5.6基础命令

    Centos7下mysql5.6数据库的操作 Mysql如何修改密码? 1.使用mysqladmin修改,这种修改方式需要知道mysql的原始密码 修改密码后我们测试下看看能不能登录成功 怎么才能不需 ...

  3. leetcode 64. 最小路径和 动态规划系列

    目录 1. leetcode 64. 最小路径和 1.1. 暴力 1.2. 二维动态规划 2. 完整代码及执行结果 2.1. 执行结果 1. leetcode 64. 最小路径和 给定一个包含非负整数 ...

  4. group by分组后对组内数据进行排序

    查询 每个班级英语成绩最高的前两名的记录 原文:https://www.cnblogs.com/hxfcodelife/p/10226934.html select a.Classid,a.Engli ...

  5. C语言 strlen

    C语言 strlen #include <string.h> size_t strlen(const char *s); 功能:计算指定指定字符串s的长度,不包含字符串结束符‘\0’ 参数 ...

  6. Linux - cron - cron 表达式

    概述 之前 cron 的补充 这次介绍下 表达式 背景 之前有说过 cron 这次说下 表达式 1. 准备 环境 os centos7 2. 模板文件 文件 位置 /etc/crontab 作用 系统 ...

  7. 重启nginx:端口被占用问题

    1.重启nginx出现端口占用问题: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) 2.解决方法: 第 ...

  8. 每天进步一点点------ModelSim仿真Altera的ROM

    1. 在QuartusII中生成rom的初始化文件,可以是hex,也可以是mif.MIF文件的格式很简单明了,所以我一向都是用MIF. 2.下载convert_hex2ver.dll文件,conver ...

  9. 题解 P2146 [NOI2015]软件包管理器

    P2146 [NOI2015]软件包管理器 感觉代码比其他题解更简洁qwq 树链剖分模板题 install x:将1~x的路径上的节点全部变成1(安装x需要先安装1~x) uninstall x:将x ...

  10. lightoj 1408 概率dp

    https://blog.csdn.net/moon_sky1999/article/details/98097470 博主在此,牛逼神犇 #include<bits/stdc++.h> ...