为什么在使用 `salt -a pam` 时提示我输入用户名和密码?

Why am I prompted to enter username and password when using `salt -a pam`?

我正在关注 https://docs.saltstack.com/en/latest/topics/eauth/index.html

上的外部身份验证文档

我已经在 master 中配置 external_auth 以允许用户 ubuntu 发出 salt 命令。

运行 salt -a pam '*' test.ping as user ubuntu 有效,但系统提示我输入用户名和密码。

我知道关于 -T 身份验证令牌选项,但它仍然需要初始密码提示并且它已过期。

命令已经作为ubuntu执行了,为什么又提示我?有没有办法完全删除提示?允许无人参与的程序 运行 作为 ubuntu 用户发出 salt 命令?

这是Saltstack的问题,还是pam配置的问题?根据文档,Saltstack 使用 login 服务(例如 /etc/pam.d/login)。

documentation 中声明:"Pass in an external authentication medium to validate against. The credentials will be prompted for. ",所以这是预期的。

如果您登录的是 master,则不必使用 external_auth

您应该改用 publisher_acl:

"The salt publisher ACL system is a means to allow system users other than root to have access to execute select salt commands on minions from the master."

有关详细信息,请参阅 docs