The NFS client is a Raspberry Pi, running Debian 12 (Pi OS), named “raspberrypi”.
The NFS server is a Thecus N5810, named “storage2”.
The /home directory is mounted like this:
user@raspberrypi:~$ mount | grep home
storage2:/pi on /home type nfs4 (rw,relatime,vers=4.1,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=192.168.1.108,local_lock=none,addr=192.168.1.67)
The problem is that when a file is created, the permissions are wrong:
user@raspberrypi:~$ rm file
rm: cannot remove 'file': No such file or directory
user@raspberrypi:~$ umask
0022
user@raspberrypi:~$ touch file
user@raspberrypi:~$ ls -l file
-rw----r-- 1 user user 0 Jun 28 11:15 file
user@raspberrypi:~$ mkdir dir
user@raspberrypi:~$ ls -ld dir
drwx---r-- 2 user user 4096 Jun 28 11:16 dir
user@raspberrypi:~$ rmdir dir
user@raspberrypi:~$ umask 0
user@raspberrypi:~$ mkdir dir
user@raspberrypi:~$ ls -ld dir
drwx---rw- 2 user user 4096 Jun 28 11:17 dir
user@raspberrypi:~$ cd /tmp
user@raspberrypi:/tmp$ mkdir dir
user@raspberrypi:/tmp$ ls -ld dir
drwxrwxrwx 2 user user 4096 Jun 28 11:18 dir
As can be seen, the problem only happens on the NFS mounted filesystem. It appears the Thecus NFS server is applying an additional umask of 071. How can I make it stop doing this?