-1

Followed SettingUpNFSHowTo | Ubuntu Community Help Wiki to create share on server, pm01, & client, 4uigL1. Both are 16.04 with latest updates. 4uigL1 is a laptop AMD A8 so using 32-bit libraries; pm01 is AMD 64-bit.
On pmo1:

$ sudo mkdir -p /export/Public101
$ sudo chmod -R 777 /export
$ cd /mnt/data
$ sudo mkdir Public101
$ sudo chmod -R 770 Public101/
$ sudo chgrp -R users Public101/
$ sudo mount --bind /mnt/data/Public101 /export/Public101
$ sudo service nfs-kernel-server restart

On client, 4uigL1:

$ sudo chmod +x /mnt
$ sudo mount -t nfs -o proto=tcp,port=2049 192.168.60.101:/ /mnt
$ cd /mnt/Public101/
$ cd /mnt/Public101/
bash: cd: /mnt/Public101/: Permission denied
$ ll /mnt
total 12
drwxrwxrwx  3 root root  4096 Mar 22 14:46 ./
drwxr-xr-x 25 root root  4096 Dec 30 14:58 ../
drwxrwx---  2 root users 4096 Mar 22 14:49 Public101/
$ showmount -e 192.168.60.101
Export list for 192.168.60.101:
/export/Public101 192.168.60.0/24
/export           192.168.60.0/24

Even when I su and try to cd /mnt/Public101 I get Permission denied

I prefer NFS over Samba because Samba shares haven't shown up when one tries to get a file to send over email or attach or trying to save a file on a share from some other program, like openoffice.

Thanks for any help!

This is the server's fstab:

#Local Share
/mnt/data/Public101     /export/Public101       none    bind    0       0

Client's:

# NFS imports
192.168.60.101:/        /mnt    nfs     auto    0       0

Server:

pete@pm01:/mnt/data$ cat /etc/exports 
# /etc/exports: the access control list for filesystems which may be exported
#               to NFS clients.  See exports(5).
# exports
/export 192.168.60.0/24(rw,fsid=0,insecure,no_subtree_check,sync)
/export/Public101 
192.168.60.0/24(rw,nohide,insecure,no_subtree_check,sync)

Client:

$ mount
192.168.60.101:/ on /mnt type nfs4  
(rw,relatime,vers=4.0,rsize=1048576,wsize=1048576, 
namlen=255,hard,proto=tcp,timeo=600,retrans=2, 
sec=sys,clientaddr=192.168.60.102, 
local_lock=none,addr=192.168.60.101)

UPDATE: On server changed owner from root to pete. No change on client, still denied.

Checked /mnt on client and found the owner of /mnt/Public101 to be 'user1'. Could not change owner as root, always permission denied. Hmm. Logout of client, login as 'user1'. Accessed the share!

History:
initially setup Xubuntu on client as 'user1' adding 'pete' as another user and using pete normally and as the main user instead of 'user1'. So now the question becomes - if user1 and pete are both in the 'users' group, why when logged in as pete can I not access the share? On boot, the client mounts the share as user1:users with 770 as permissions.

  • It's hard to read the details, can you please format the commands ? – bistoco Mar 22 '18 at 20:05
  • Can you add the contents of the /etc/exports file on the server? Can you add the output of "mount" on the client (just the relevant line) after you have mounted the share? – Sebastian Stark Mar 22 '18 at 20:08
  • It should work if you create a directory or file on the share on the server, chown it to some user, then access it from the client as the same user. – Sebastian Stark Mar 22 '18 at 20:22
  • This whole thing started when I was setting up my RPi with openmediavault when I couldn't see the NFS share but did see the samba one. So I tried going back to the 'basics'. – Peter Martin Mar 22 '18 at 20:25
  • Continuing to experiment, I ended up changing the client's permissions to 777 and I was able to get 'pete' to access it and not just 'user1'. Not the solution we need as I don't want to open it up to anyone. – Peter Martin Mar 22 '18 at 22:29

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.