請問在 k8s POD 裡面可以 SUDO SU 嗎
kubectl exec -ti xxxxPOD -- /bin/sh
sudo su
做了之後給我錯誤訊息
sudo: effective uid is not 0, is /usr/bin/sudo on a file system with the 'nosuid' option set or an NFS file system without root privileges?
想不到預設不能sudo su的理由,你有試過其他container嗎? 我自己k8s的pod是沒有問題,感覺是image相關的問題
恩恩 感覺是 image 問題,但他設定 不能的話 我去改這個
Well actually, that's how sudo works...
Your user executes the binary /usr/bin/sudo
/usr/bin/sudo has the Sticky Bit set for the User (aka SUID) and the file is owned by the root user to the program will run as root even though you executed it as a non-root user.
/usr/bin/sudo reads the configuration files in /etc and will execute other commands as allowed by the configuration files.
應該 應該也是沒權限吧 這個不是要ROOT 才能改嗎 ??