虚位以待(AD)
虚位以待(AD)
首页 > 操作系统 > RedHat/Centos > Centos配置sudo用户

Centos配置sudo用户
类别:RedHat/Centos   作者:码皇   来源:互联网   点击:

以下主要内容是Centos配置sudo用户;使用visudo命令进行sudo配置文件的编写;有需要的朋友可以参考下

使用visudo命令进行sudo配置文件的编写

    ## The COMMANDS section may have other options added to it.#### Allow root to run any commands anywhereroot ALL=(ALL) ALLansible ALL=(ALL) ALL## Allows members of the 'sys' group to run networking, software,## service management apps and more.

当前需要做sudo的用户为ansible,即将其添入root行下方
保存退出即可

免密码sudo

    ## The COMMANDS section may have other options added to it.#### Allow root to run any commands anywhereroot ALL=(ALL) ALLansible ALL=(ALL) NOPASSWD:ALL## Allows members of the 'sys' group to run networking, software,## service management apps and more.

只需要将对应用户的行设置 NOPASSWD即可实现无密码sudo

相关热词搜索: Centos 配置sudo