[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Permission issue



Richard Owlett wrote:
> My dual boots Squeeze and Wheezy.
> I've created a partition whose function in life is to be essentially
> a scratch pad for all groups/users of both.
> How do I force all files to be written to that partition to be
> readable AND writable to everybody?

You are creating a multi-boot system to access the same files.  I know
of no better way than to synchronize the uid:gid of the users you care
about across those different boot systems.  If the user has the same
uid:gid then they will all have sane access.

This is the same problem as using NFS across multiple systems.  You
might look to see the NFS solutions.  They all synchronize the uid and
gid of the user.  (No I am *not* suggesting you use a network.  I am
only saying that the problem of different systems needing synchronized
user id numbers is the same problem.)

This is also the same problem as using a chroot.  The system in the
chroot needs to have the same uid:gid numbers if accessing the same
files such as from a bind mount.  Same problem.

For me I would simply brute force through it.  Brute force and
ignorance will always triumph over elegance and finesse.  How many
systems do you have?  Two?  How many users are we talking about?
Three, four, five?  Simply edit these files on both systems and make
sure the users have the same uid:gid combinations on both of them.

  /etc/passwd
  /etc/group
  /etc/shadow
  /etc/gshadow

It is a little bit messy to change but doable.  Easier to have done
from the beginning.  But too late for that now.  After changing those
files then go back and change the home directories for those users.

  chown -R user1:user1 /home/user1
  chown -R user2:user2 /home/user2

That should set things up.  They will be able to log in the same as
before but now will have different id numbers.  If the users have the
same id numbers in all of the shared systems then when the disk is
mounted they will have the same permissions as on the other system.

And then I would also set up group access for those users.  This is
the same as if they were on the the same single system.  Put all of
the different users that need to share files into a group.  Make the
directories that you want to share be group-owned by that group.  Set
the directory to be g+ws.  David's previous references had good
information on the details of setting up group access.  You could
probably make just group access work but there are still snags and
pitfalls so I would do both the above synchronization of uid:gid
numbers and also set up group access.  Having both will do exactly
what you want it to do.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: