Can't get write access to an NFS share (Can get read only access)

freddymcwilliam

Dabbler
Joined
May 5, 2020
Messages
12
Hey guys, I am very amateur. I have spent a long time trying to get NFS to work. I seem to have read only access. My question is, how can I create an NFS share that I can edit from my client machines??

My objective:
- Create an NFS share that anyone on my wifi network can read and modify

What I did on the NAS:
- Purchased a FreeNAS mini E+
- Connected it to my router and turned it on
- Inserted a single drive (at this stage, cause still playing) and configured it with the only raid option I had (single disc)
- Created a Pool called "ExprimentPool"
- Went to "Shares -> NFS" and created a share with path "/mnt/ExperimentPool". I also ticked the "All dirs" check box.

Then I tried to set up a Linux client using the following command:
- sudo mount -t nfs 192.168.42.240:/mnt/ExperimentPool /home/freddy/ExperimentPool

It appears to mount, I can see the share but I can't edit it!!

Then I tried on a Mac client. Again I can see the share but when I try to edit it I am asked for a username and password. Can anyone help me make it so that I can gain read and write access to this share?
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hey Freddy,

Your problem here is related to permissions in the file system.

In the NAS, the files and directory are owned by Root, so are writeable only for that one. Still, the content is readable by everyone, so you can see it from your mounted share.

You need to :
--Create a user for your shared data : testuser
--Make that guy owner of your shared folder and its content : chown -R testuser /mnt/ExperimentPool
--In your NFS share options, select to squash all user access to testuser

I recommend you do not work at the root of your pool and create at least a dataset for that. You then share that dataset or a subfolder in it.

Have fun discovering your new toy,
 

freddymcwilliam

Dabbler
Joined
May 5, 2020
Messages
12
Awesome!!! Thank-you, I new it would be simple.

Your information has helped me change the NFS owner and to read and write access from my clients, but I still don't know what this bit means:
"In your NFS share options, select to squash all user access to testuser"

Are you able to explain that bit in any more detail?
 

Heracles

Wizard
Joined
Feb 2, 2018
Messages
1,401
Hi,

In the left column, you click Sharing and then, Unix Shares. You then click on the dots for your share and select Edit. In the Advanced Mode, that it were you have the option to re-map either only Root or all users to a specific account.

If you re-map all users to the same account as the owner in the file system, then they will have have the same access, including write
 

freddymcwilliam

Dabbler
Joined
May 5, 2020
Messages
12
This is fantastic, thank-you! My understanding is improving a lot now.

On my linux client, how can i specify which user I am connecting to the NFS share as? At the moment I have the following entry in my fstab file and it works, but I don't know how to specify a particular username and password?

192.168.42.240:/mnt/ExperimentPool/Dataset1 /home/freddy/FreeNASmini/Dataset1 nfs user 0 0

Can anyone help me with this?
 
Top