On Wed, Feb 08, 2023 at 09:27:34PM +0530, Sandeep Gupta wrote:
> I have a default installation of openbsd, with portmap, mountd, nfsd
> services started via rcctl. I have following entry in /etc/exports
> 
> /nfs/testdir -alldirs  -maproot=root -network=192.168.0 -mask=255.255.255.0
> 
> I am able to mount the exported share on client (centos) as follows:
> 
> sudo mount -t nfs -o rw,noauto -v 192.168.0.122:/nfs/testdir mntpt3
> 
> From the client, I can read the contents. But writing inside the mounted
> directory yields permission denied error. Looking at the docs I am not able
> to find any otherconfig options for access control on the client side.
> There is nothing in the logs on the server side as well. Any pointers to
> debug/fix would be of great help.

Can you check the uid and gid of the user on the client and the server ?

The user needs to have the same uid on both systems as NFS works with the 
numerical IDs (uid/gid.)

This won't work:

Server: 
bambi$ doas useradd -m -u 10000 -g 10000 test
bambi$ doas mkdir /exports/test3                                                
                                    
bambi$ doas chown test:test /exports/test3                                      
                                    

Client:
creith@molloy:~$ sudo useradd -m -u 10001 -g 10001 test
creith@molloy:~$ sudo su - test
test@molloy:~$ touch /mnt/test3/hallo
touch: '/mnt/test3/hallo' kann nicht ber??hrt werden: Keine Berechtigung

Sorry for the German, it means: Permission denied.

:wq
Carsten

Reply via email to