我是靠谱客的博主 高挑花卷,这篇文章主要介绍Centos配置sudo用户,现在分享给大家,希望可以做个参考。

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

## The COMMANDS section may have other options added to it.
##
## Allow root to run any commands anywhere
root    ALL=(ALL)       ALL
ansible 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 anywhere
root    ALL=(ALL)       ALL
ansible ALL=(ALL)       NOPASSWD:ALL
## Allows members of the 'sys' group to run networking, software,
## service management apps and more.

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

最后

以上就是高挑花卷最近收集整理的关于Centos配置sudo用户的全部内容,更多相关Centos配置sudo用户内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(221)

评论列表共有 0 条评论

立即
投稿
返回
顶部