[LBo] File permissions
Anita Lewis
a.lewis at linuxbasics.org
Sun Jun 17 13:00:19 CEST 2007
On 06/12/2007 08:10 AM Troy wrote:
>
> "users" is the group for the pictures directory. I've set the group suid
> and umask on the "pictures" directory, but the pictures transferred from the
> removable media card maintain the permissions on the card, and do not
> inherit the permissions I set on the directory. Someone in a Linux chat
> room said I need to find the file that is assigning the permissions to the
> removable media card, and change the permissions in that file to the
> permissions I want. Do you know where this file maybe located?
I think I finally found an answer. First I did try changing permissions
on the mount point for my Lacie usb hard drive which is fat32 formatted
and it still mounted with the same permissions as before. I do have it
set to mount with users and I imagine there would be a way to set it in
/etc/fstab so that it has the proper umask.
With the hotplug automounting it is a bit of a chore to set udev up so
that you can actually control the mount point these days.
Also, I noticed that even when I set the umask to 002, when I copy
something into the directory, it keeps the permissions it had. I think
the umask only affects *created* files and not copied ones.
However, here is an easier way I think. Use the 'install' command
rather than 'cp'. This command allows you to set group and permissions.
See the manpage on it, but basically it is like this:
install -m 664 source destination
This will give rw-rw-r-- on the files when they get there no matter what
the permissions are in the destination. Since you already have the group
suid set, you don't need to set the group as well, but that is also
possible with 'install'.
Anita
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: OpenPGP digital signature
Url : http://LinuxBasics.org/pipermail/qna/attachments/20070617/e281fcf6/attachment.pgp
More information about the QnA
mailing list