LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-26-2020, 03:26 AM   #1
HTop
Member
 
Registered: Mar 2019
Posts: 44

Rep: Reputation: Disabled
NFS share and permissions


Hello,
I have to export a folder via NFS. On this folder, files are written by a user who is uid = 1009, gid=1009.
The export is exported read & write and it is accessible.

The NFS client user is uid = 1010, gid=1010. Such client needs to read, write and delete files on the NFS share. Also server's user has to put files on its folder.

Unfortunately, client user is not able to do because files are owned by a different user uid = 1009, gid=1009.

I'm not allowed to change UID and GID of client and server.
How can I set the export permissions and client nfs mount option in order to let client user work?

Regards,
H.
 
Old 04-26-2020, 03:36 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,103

Rep: Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365Reputation: 7365
look for NFS uid/gid mapping on the net
 
Old 04-26-2020, 03:45 AM   #3
HTop
Member
 
Registered: Mar 2019
Posts: 44

Original Poster
Rep: Reputation: Disabled
Thank you for your reply, can you give me more details or an example?
 
Old 04-26-2020, 04:15 AM   #4
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,688

Rep: Reputation: Disabled
See idmapd.conf(5).
 
Old 04-26-2020, 07:52 AM   #5
HTop
Member
 
Registered: Mar 2019
Posts: 44

Original Poster
Rep: Reputation: Disabled
The remote user is not in a domain.
What should I put on the Static section?
 
Old 04-26-2020, 09:30 AM   #6
HTop
Member
 
Registered: Mar 2019
Posts: 44

Original Poster
Rep: Reputation: Disabled
I did this, but not working, I'm still getting Permission Denied whe I tried to create a file from client on the nfs share.

SERVER IP: 192.168.217.12
CLIENT IP: 192.168.217.14

On server:
cat "/etc/exports"
/export 192.168.217.14(rw,sync,no_root_squash,no_subtree_check,fsid=452)

On client:
cat "/etc/fstab"
192.168.217.12:/export /mnt nfs4 nfsvers=4,rw 0 0


On Client:
/etc/idmapd.conf

[Translation]
Method=static
[Static]
donald@192.168.217.12 = micky
 
Old 04-26-2020, 11:17 AM   #7
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by HTop View Post
/export 192.168.217.14(rw,sync,no_root_squash,no_subtree_check,fsid=452)
The combination of "rw" and "no_root_squash" is very insecure, unless you're the (only) root administrator on both machines!

Furthermore (never used this myself) I think the rpc.idmapd daemon must be started on the server (this is NOT the default). I quote
Quote:
rpc.idmapd is the NFSv4 ID <-> name mapping daemon. It provides functionality to the NFSv4 kernel client and server, to which it communicates via upcalls, by translating user and group IDs to names, and vice versa.
and
Quote:
Note that on more recent kernels only the NFSv4 server uses rpc.idmapd.
The NFSv4 client instead uses nfsidmap(8), and only falls back to rpc.idmapd if there was a problem running the nfsidmap(8) program.
 
Old 04-28-2020, 07:43 AM   #8
HTop
Member
 
Registered: Mar 2019
Posts: 44

Original Poster
Rep: Reputation: Disabled
Thank you.
I will try to remove no_root_squash and enable rpc.idmapd.

---
I tried but rpc.idmapd or rpcbind service is already started and the change did not work.

Last edited by HTop; 04-28-2020 at 08:49 AM.
 
Old 04-29-2020, 06:36 AM   #9
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Instead of asking for every hurdle you encounter you should really read up on the topic:
Quote:
Originally Posted by pan64 View Post
look for NFS uid/gid mapping on the net
FWIW, the arch wiki has a good NFS article.
 
1 members found this post helpful.
Old 05-20-2020, 06:01 PM   #10
Hailey's_Comet
Member
 
Registered: Jul 2005
Location: USA
Distribution: PCLinuxOS
Posts: 36

Rep: Reputation: 18
Quote:
Originally Posted by ondoho View Post
FWIW, the arch wiki has a good NFS article.
Thanks, I found what I needed! My requirements are that no matter who accesses the folder, the owner and group need to be mapped to the same SERVER user. Basically, what I used to use samba for but now Windows is not involved.

My config is:
closed, secure network (I.E., 4 computers and no internet)
on the server, u/gid 33=www-data

export:
/var/www 192.168.0.0/24(rw,all_squash,anonuid=33,anongid=33)

"all_squash" = all users are considered anon
"anon*=" map anonymous to...
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Easy NFS Share Setup In Ubuntu, Linux Mint Or Debian With Simple NFS GUI (Server And Client) LXer Syndicated Linux News 0 11-22-2018 03:22 PM
NFS Share within an NFS Share tiberus Linux - Server 2 05-25-2010 10:28 AM
sabayon user owns nfs share - normal user can't write to share tdos20 Slackware 1 06-21-2008 01:01 PM
Placing a SMB share inside an NFS share grittyminder Linux - Networking 0 05-14-2008 03:49 AM
In NFS server. I want to share directory but i dont want to share subdirectories. aashishdhabarde Linux - Server 1 01-16-2008 03:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration