Hi, I have configured NFS on my server (10.17.170.126 OpenBSD 5.1). Here is my /etc/exports: /data/ftp/vsftpd/D01 -alldirs -mapall=ftpadm 10.16.128.129 10.16.10.175 (I have tested -maproot and/or without -alldirs, but I have experienced the same problem).
Here is the directory: # ls -l /data/ftp/vsftpd/ | grep D01 drwxr-xr-x 4 ftpadm ftpadm 512 Sep 17 18:29 D01/ daemons start OK: # /etc/rc.d/portmap start portmap(ok) # /etc/rc.d/mountd start mountd(ok) # /etc/rc.d/nfsd start nfsd(ok) I can mount the NFS share from both the Linux client (10.16.128.129) as well as from an OpenBSD client (10.16.10.175). I have two issues, which I will address the first one in this email. This is about the Linux client. My problem is that the "-mapall=ftpadm" doesn't seem to have any effect, or maybe I have understood the role of this parameter wrongly! On Linux I have mounted the NFS share with: mount -t nfs -o rw,noatime,intr,soft,nosuid,nodev,vers=3,proto=udp,rsize=8192,wsize=8192 10.17.170.126:/data/ftp/vsftpd/D01 /mnt (actually I have tested all combinations of mount options, but I have experienced the same problem). Here is the mounted filesystem on the Linux client: # ls -l / | grep mnt drwxr-xr-x 4 ftpadm ftpadm 512 Sep 17 18:29 mnt/ Now I can create files on the NFS share using the account "ftpadm" without any problem. But using any other account (including root) it doesn't work: # sudo -u ftpadm touch /mnt/t # ls -l /mnt/t -rw-r--r-- 1 ftpadm ftpadm 0 Sep 17 19:29 /mnt/t # sudo -u dns touch /mnt/t0 touch: cannot touch `/mnt/t0': Permission denied # touch /mnt/t1 touch: cannot touch `/mnt/t1': Permission denied Now if on the server I change the mode of the directory to be writeable by all, the behavior is different. On OpenBSD server: # chmod o+w /data/ftp/vsftpd/D01 # ls -l /data/ftp/vsftpd/ | grep D01 drwxr-xrwx 4 ftpadm ftpadm 512 Sep 17 19:18 D01/ After I umount on Linux client, restart all daemons on OpenBSD server, and remount on Linux client, I see: ls -l / | grep mnt drwxr-xrwx 4 ftpadm ftpadm 512 Sep 17 19:18 mnt/ And I can write to the NFS share with any user (including root): # sudo -u dns touch /mnt/t0 # ls -l /mnt/t0 -rw-r--r-- 1 dns ftpadm 0 Sep 17 19:35 /mnt/t0 # touch /mnt/t1 # ls -l /mnt/t1 -rw------- 1 4294967294 ftpadm 0 Sep 17 19:35 /mnt/t1 With the ordinary user "dns" the owner of the fie is set to the same user account who has issued the commnad (i.e. "dns"), and with root the owner is set to "4294967294" (which I think is the same as -2). Both files have the group "ftpadm". Is this OK although the -mapall switch is in place in exports file? Additionla info: umask of root is: 0077, and umask of dns is 0002 # umask 0077 # su - dns $ umask 0002 What I am trying to achieve is that all files on the NFS server are created as owned by ftpadm:ftpadm, irrespective of the account used on NFS client. I thought this is possible using "-mapall" switch. Apparently I am missing something here. Thanks for your help. Hossein Badbanchi [email protected]

