docker容器中使用chattr修改文件权限报错 "chattr Operation not permitted while setting flags on ***"
docker中默认是禁止 CAP_LINUX_IMMUTABLE 的 像chattr这些命令,是无法正常使用的, 如果使用 chattr +i file 会提示 chattr: Operation not permitted while setting flags on *** 要正常使用chattr等命令, 需要开启 CAP_LINUX_IMMUTABLE
docker run -it --cap-add LINUX_IMMUTABLE xxx |
如果提示没有chattr命令,需要安装e2fsprogs
centos/redhat/archlinux
yum -y install e2fsprogs |
debian/ubuntu
apt-get install e2fsprogs |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Hao DevSecOps!
评论



