LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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, 06: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, 03:01 PM   #2
netnix99
Member
 
Registered: Jun 2011
Distribution: redhat, CentOS, OpenBSD
Posts: 266

Rep: Reputation: 90
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-04-2013, 12:14 AM   #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-04-2013, 12:23 AM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
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, 01: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, 05:08 AM   #6
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
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, 10: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, 10:53 PM   #8
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.6, Centos 5.10
Posts: 16,324

Rep: Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041Reputation: 2041
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-07-2013, 12:26 AM   #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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 04:01 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration