File Ownership problems when NFS Share/Mount a drive

Hi all,

I am new to solaris. I'm facing file ownership problems when NFS Share/Mount a drive.

Please read the scenario below for more details

I have two solaris boxes which have solaris9 installed on both.

I have NFS shared and mounted a file system as follows

Host1

Shared a folder /sharedFromHost1 from host1 to host2 with the following command in dfstab file

share -F nfs -o ro,rw=host2,root=host2 /sharedFromHost1

Host2

Created mount point /mountToShare in host2, then Mounted the shared drive from host1 with the following command

mount host1:/sharedFromHost1 /mountToShare

If I create any file under /sharedFromHost1 from host1, it's getting reflected in host2's /mountToShare directory. And the same is working fine when created a file from the otherside also.

But the problem is with the users and user ownership to the files created in the hosts.

We have a user/group 'user1/group1' created on both the hosts. So that we can change(su) to the user user1 and can create files. Then that file should be owned by user1(user)/user1(group).

The issue here is, as 'user1'

when we create a file in /sharedFromHost1 from host1, and if we see the same file in /mountToShare directory from host2, the ownership of the file is shown as 2001(user)/606(group) instead of user1(user)/user1(group)

Also when we create a file in /mountToShare from host2, and if we see the same file in /sharedFromHost1 directory from host1, the ownership of the file is shown as 103(user)/sssteam(group) instead of user1(user)/user1(group)

But strictly we want to see the user/group as user1/user1 for all the files created by user1.

Did anyone of you gone through similar kind of situation or anybody who knows the solution? It would be great if you can help me regarding this.

Please let me know if you need any more details about the scenario

Thanks in advance

[1974 byte] By [Neo369a] at [2007-11-27 2:18:06]
# 1

Please don't post to multiple forums with the same question.

I think the cause of the behaviour is that in NFS versions 2 & 3,

which are what you get in Solaris 9, login strings are not

used for user identities.User IDs (uids) are. Logins are

mapped to uids by /etc/passwd/

So, I would think that running the 'id' command against

user1 on host1 will not currently give you the same result

as running the 'id' command against user1 on host2

host1# id user1

uid=2001(user1)

host2# id user2

uid=103(user1)

If that's the case, then the fix is to synchronise the uids.

host1# usermod -u user1 103

or vice versa.

You'll also need to change the ownership or any files owned by

user1 on the host you choose to change the uid of user1 on.

usermod -u does _not_ go & find all the files user1 owns and

change the ownership to 103.

Something like

find / -user 2001 -ok chown 103 {} \;

Please check that this won't break anything user1 needs to be able to

do.

cheers.

PS. Same for groups & group IDs (gids): groupmod.

kidari..a at 2007-7-12 2:17:18 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...