我sudo
在 Debian 8 上遇到了一个相当奇怪的问题。用户无法在/etc/sudoers.d
. 我使用 Chef 来分发配置,所以所有文件都是自动生成的。
例子:
这个配置工作正常
root@server:~# cat /etc/sudoers.d/nginx
# This file is managed by Chef.
# Do NOT modify this file directly.
user ALL=(root) NOPASSWD:/usr/sbin/nginx
Run Code Online (Sandbox Code Playgroud)
这失败了:
root@server:~# cat /etc/sudoers.d/update-rc.d
# This file is managed by Chef.
# Do NOT modify this file directly.
user ALL=(root) NOPASSWD:/usr/sbin/update-rc.d
user@www42:~$ sudo update-rc.d
[sudo] password for user:
Sorry, user user is not allowed to execute '/usr/sbin/update-rc.d' as root on server.
Run Code Online (Sandbox Code Playgroud)
有什么问题?
诊断:
Mar 5 12:12:51 server …
Run Code Online (Sandbox Code Playgroud) 我需要授予进程(构建管道)对 AKS API 的 RBAC 访问权限以进行部署。但目标 AKS 群集已激活 AAD 集成(如此处所述)
我原本希望能够通过简单的服务主体访问 AKS API,但我被重定向到设备登录页面:
$ az login --service-principal --username [REDACTED]-XXXX-XXXX-XXXX-XXXXXXXXXXXX --password [REDACTED]XXxxXXxxXXxxxXXXxxXXxxXXxx= --tenant [REDACTED]-XXXX-XXXX-XXXX-XXXXXXXXXXXX
$ az aks get-credentials -n oli-aksdemo01 -g oli-aksdemo01
Merged "oli-aksdemo01" as current context in /home/olivier/.kube/config
$ kubectl get nodes
To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code C2NP77EGR to authenticate.
Run Code Online (Sandbox Code Playgroud)
:-(
在 Azure 上集成 AAD 的 AKS 群集上对服务主体进行身份验证时,是否有办法避免设备登录页面?