How to set multiple ownership permission on a file/directory?

Hi,

Any ideas to set multiple ownership permission on a file/directory on Solaris? I need a folder to have multiple ownership on the 2 nodes servers. The 2 nodes servers require to mount a SMBFS with different user ID. Please assist. Thanks.

Hi freshmeat,

Am I correct when I say this is a Cluster, if it is can you give us some more info on the configs.

I'm not sure that you'd be able to mount this up with two unique UID's, as when the service fails over all the existing connections will be lost - the good thing is that the half that couldn't work will now be working.

I's possibly a little messy, but it would be better to use the group access for the fail over service.

Regards

Gull04

As far as I am aware, there is no multiple ownership. Each 'file' has one owner & one group associated with it. These are stored as the UID number & GID number from /etc/passwd & /etc/group respectively. If the 'file' is shared between servers and the names associated to the UID & GID do not match the it can be very confusing. Normal file permissions also include the global/other/world permissions.

You can, however. look at something called Access Control List (ACL) for each 'file' Within them, you can define more individual accounts or groups to have specific access, but there is still only one true owner.

Have a read of this manual page to see if it helps.

I've used 'file' to refer to any object in the directory tree including files, directories, pipe, fifo, devices etc.

Kind regards,
Robin

Hi Gull04,

This is not a cluster disk but it is only a normal folder and need to mount as SMBFS. For example, the ownership is ID A and able to mount SMBFS on node1. On node2, ID B not able to mount SMBFS due to the folder ownership is ID A.

Hi freshmeat,

OK, sorry for my confusion there - but when you mention nodes I think cluster.

Anyway back to your original problem;

There is no way to have multiple owners for a Unix "file", so your options are limited here. The one that comes to mind is that if you only have a couple of "nodes", you can hopefully standardise your UID's and GID's over the "nodes".

If it is possible to do that I would, as once you get into larger numbers of systems it can become a real pain managing this.

Regards

Gull04

Wouldn't group permissions help?

I'm afraid it won't. Smbfs documentation states the mount point most belong to a user for him/her to be able to mount a share without being privileged. How to Mount a CIFS Share on a Directory You Own (Solaris CIFS Administration Guide)

As already suggested, ACL might help here. You can grant both users the right to get ownership of the directory (write_owner:allow ACL). Before performing the mount, they just need to change it if required and that's it.

Alternatively, you might use sudo to achieve your goal.

1 Like