I have ssh'd into a CentOS 7 docker container as root. I am trying to create a directory (mkdir mydir/test) but I am getting a permission denied error. I tested to make sure I was root with



Then I looked at the permissions:

ls -l

drwxr-xr-x 2 root root 64 Apr 10 22:14 mydir

I believe, from the first rwx, that root has privileges to create directories inside this directory, but I cannot and do not understand why.

I also thought that maybe giving the group write permissions would work, so I tried chown 020 mydir, but this resulted in changing permissions of ‘mydir’: Operation not permitted. Can someone explain what I'm doing wrong?

  • 1
    Is mydir a mounted volume? – jordanm Apr 18 at 17:50
  • how can I check? – jss367 Apr 18 at 17:52
  • Yes, I believe it is – jss367 Apr 18 at 17:57
  • If it is a mount, it would help to add the information about what kind of mount it is, what options the mount is using, and the mount permissions (from the host's perspective) to your question. – GracefulRestart Apr 18 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.