使用visudo命令進(jìn)行sudo配置文件的編寫(xiě)
## 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.
當(dāng)前需要做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.
只需要將對(duì)應(yīng)用戶的行設(shè)置 NOPASSWD即可實(shí)現(xiàn)無(wú)密碼sudo
新聞熱點(diǎn)
疑難解答
圖片精選