LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 03-02-2013, 05:25 AM   #1
sree.m
Member
 
Registered: Feb 2012
Posts: 56

Rep: Reputation: Disabled
Smile Unable to change ownership of NFSv4 shared directory in redhat linux 6.3


Hi there,

I'm struck with a weird problem here.request your help.

I have enabled NFSv4 in one of my RHEL 6.3 server and mounted the same in RHEL 6.3 client. Now I wish to change the ownership of one of the file in nfs shared directory which is being prevented by the OS. Following is the error I received when I try to do so.

Code:
[root@cialqec os_pkgs]# chown crqadm.dba ss
chown: changing ownership of `ss': Invalid argument
Errors received in /var/log/messages in both client and server are

SERVER
Code:
Mar  2 16:48:06 cialdec rpc.idmapd[27958]: nss_getpwnam: name 'crqadm' not found in domain 'cok.aero'
CLIENT
Code:
Mar  2 15:29:23 cialqec kernel: NFS: v4 server 10.10.10.31 does not accept raw uid/gids. Reenabling the idmapper.
Seems like it is unable to map the user id of client in the server.

Pls post in a solution. Thanks in advance

Rgrds,
Sreejith
 
Old 03-03-2013, 02:01 PM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 298

Rep: Reputation: 99
Sreejith,

What method of authentication are you using for the server and client? Unless you are using something like LDAP or NIS to authenticate all of the machines to a single source, you cannot change the permissions on an NFS share. If you are using one of the authentication methods I mentioned, the root user on the client machine that you are logged in too will have to have root permissions on the NFS share in order to change owner of a file. This may sound odd, but root on one machine is not root on another without explicitly specifing that authority on the NFS share from the server. On the client machine, "root" will be seen as nfsnobody. You can test this by creating a file on the share and seeing what permissions you actually have.

HTH....if you stillhave trouble, please give more details about the current setup for clarity.
 
Old 03-03-2013, 11:14 PM   #3
sree.m
Member
 
Registered: Feb 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Smile

Thanks for your valuable reply.

I'm very new to the terms LDAP and NIS.It will be of great help if you could give me more clarity on how to setup NIS/LDAP on server and client? and why is it required?

Regards,
Sreejith
 
Old 03-03-2013, 11:23 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
They're not necessarily required; they are centralised authentication systems instead of using local (per machine) authentication.
LDAP is similar (ish) to MSWin AD.
NIS is a simpler equivalent, and not much used as its strictly plaintext.

With NFS, the uid (not the username) must match on both ends of the connection.
(Also gid if using group perms)
See Chap 18 http://www.linuxtopia.org/online_boo...ion/index.html.

This site has howtos for the various protocols http://www.linuxhomenetworking.com/
 
Old 03-04-2013, 12:21 AM   #5
sree.m
Member
 
Registered: Feb 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Hi,

I am little more familiar with Solaris NFS, where in this id mapping will happen automatically. No NIS or LDAP is needed.

Now here in linux, the scenarios is , I have an NFS server with few user names of UIDs 501,502,503 and in the NFS client I have different user names with same UIDs as in server.

In NFS client,I need to change the ownership of a directory in NFS share from root to user1(UID 501). In NFS server UID 501 is mapped to user3.

Can you suggest me a way forward?

Thanks,
Sreejith
 
Old 03-04-2013, 04:08 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
id mapping is not automatic; its a requirement of NFS that they (uids, gids) be the same to effect normal usage, so the Admins will arrange that.
Normally NFS exports are created such that the client root id is downgraded (option root_squash); often as 'nfsnobody' or 'nobody' username, uid typically 65536 or some such.
Its not a good idea to allow remote root users access to the server.

Since ownerships can only be set by root, ownerships need to be changed at the server end.

See those links of mine.
 
1 members found this post helpful.
Old 03-04-2013, 09:39 AM   #7
sree.m
Member
 
Registered: Feb 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Smile

Thanks chrism01 for your advice.

But the NFS shared directory is for taking db level backup from all clients where it is mounted.So the ownership of the directory must be set to DB backup user name which differs between clients. Can you give me a solution/work around to achieve this ?

Rgrds,
Sreejith
 
Old 03-04-2013, 09:53 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,358

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
In that case, I'd create (on the SERVER) a dedicated DB_backup gid and make that the gid of the (SERVER) export. Create the same gid on the clients and you're gold
Remember that a user can be a member of multiple groups.
 
1 members found this post helpful.
Old 03-06-2013, 11:26 PM   #9
sree.m
Member
 
Registered: Feb 2012
Posts: 56

Original Poster
Rep: Reputation: Disabled
Smile

Very good advice. Thank you so much.

Rgrds,
Sreejith
 
  


Reply

Tags
linux, nfs, redhat



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
Automatically change permissions/ownership of files in a directory Shimdidly Linux - Newbie 3 04-08-2012 08:22 PM
[SOLVED] No way to change ownership from "nobody:users" on shared server?! macinix Linux - Newbie 5 12-04-2011 07:49 PM
Change ownership of an entire directory. Shay Linux - Newbie 3 07-02-2010 09:03 PM
Creating script to change ownership directory on RHEL4U3 at startup Ferianto Linux - Enterprise 9 02-13-2008 10:01 PM
unable to change ownership arjunjeyaprakash Linux - Newbie 12 09-06-2005 02:02 PM

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

All times are GMT -5. The time now is 09:46 PM.

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