How do I mount a nfs or any other share which requires usage of -o in the mount command so that the mount can be accessed by non-root user. If mount is user with -o option, it complains that only root can do that but if I do that as a root, the normal user cannot write to that because the directory becomes root to where it is mounted becomes root owned. Is there an option for mount to avoid this?
2 Answers
If you'd connect through cifs, you may want to use I.E. dir_mode and file_mode options.
This works perfectly to me, every folder and file is writable by anyone.
mount -t cifs //server/path -o user=username_on_server,dir_mode=0777,file_mode=0776 target_dir However, I don't see such an option for nfs.
More about NFS permissions can be found on centos.org
- Isn't there an option for mount to specify user id who can write to that mount? I vaguely remember something like uuid...atapaka– atapaka2018-01-10 11:07:21 +00:00Commented Jan 10, 2018 at 11:07
- UUID serves rather for filesystems :(Edvard Rejthar– Edvard Rejthar2018-01-10 11:32:23 +00:00Commented Jan 10, 2018 at 11:32
You can use fuse to mount various file systems as ordinary users.
I would definitely use fuse for sshfs, encrypted fileshare, and mountable by ordinary users, provided they are allowed to ssh into the file server.
/etc/fstabfile, you can add the,useroption (which allows users to mount)