0
jenkins@hostname:~/dir1/dir2$ ls -ld /some-nfs
drwxrwxrwx 121 171 146 6290 Feb  8 15:38 /some-nfs

jenkins@hostname:~/dir1/dir2$ ls -ld /some-nfs/important-dir
drwxrwxrwx 3 jenkins jenkins 28 Feb  8 15:39 /some-nfs/important-dir

jenkins@hostname:~/dir1/dir2$ mkdir /some-nfs/important-dir/important-dir/logs # able to create a dir

jenkins@hostname:~/dir1/dir2$ ls -ld /some-nfs/important-dir/logs
drwxrwxr-x 2 jenkins jenkins 0 Feb  8 15:39 /some-nfs/important-dir/logs

jenkins@hostname:~/dir1/dir2$ touch /some-nfs/important-dir/logs/file # not able to create a file
touch: cannot touch ‘/some-nfs/important-dir/logs/file’: Permission denied

Why am I getting Permission denied in the last step ?

I was expecting to be able to create the file.

7
  • Where is here? Is this an NFS mount from somewhere else? If so, are you synchronizing user IDs manually, or with NIS or LDAP?
    – Spooler
    Feb 9, 2018 at 0:44
  • /some-nfs is an nfs mount. I am not synchronizing my user ids. jenkins user is not an ldap user. It exists on the machine because I have jenkins installed on the machine. Feb 9, 2018 at 0:48
  • So is the user ID for jenkins on this example machine the same as the ID for jenkins on the NFS server?
    – Spooler
    Feb 9, 2018 at 0:49
  • jenkins does not exist on the nfs server. Feb 9, 2018 at 0:51
  • But please note I am able to create a directory using mkdir but not able to create a file using touch Feb 9, 2018 at 0:51

1 Answer 1

1

NFS by default will downgrade any files created with the root permissions to the nobody:nogroup user:group.

This is a security feature that prevents privileges from being shared unless specifically requested.

It may be that you would like to enable the "no_root_squash" option in the nfs server's /etc/exports file.

There is a really nice article about root_squash that I recommend you to read before deciding if it's the correct solution for you.

2
  • I do not have access to server's /etc/exports file and there is no way I can get that access. Even if I did get access I will not be allowed to change the /etc/exports file. Feb 9, 2018 at 1:34
  • 1
    Then I don't think you'll be able to solve it.
    – Itai Ganot
    Feb 9, 2018 at 2:51

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.