Centos配置sudo用户

番茄系统家园 · 2022-09-29 09:24:59

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

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

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

免责声明: 凡标注转载/编译字样内容并非本站原创,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如果你觉得本文好,欢迎推荐给朋友阅读;本文链接: https://m.nndssk.com/xtwt/205467l36Jhg.html
猜你喜欢
最新应用
热门应用