LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Inheriting file permissions (https://www.linuxquestions.org/questions/linux-security-4/inheriting-file-permissions-459547/)

Hardip 06-29-2006 03:11 PM

Inheriting file permissions
 
I have just moved our documents folder to a linux box from windows. This folder contains numerous other folders and files for our association. All these folders, subfolders and files are to be accesed by our accounts group. How can I set these permissions. Do I have to set them on individual files or is there a command I can use ??
By the way, I am a newbie on this issue and a recent linux convert

pljvaldez 06-29-2006 03:21 PM

man chown and man chmod will both help. I think to make them all owned by the accounts group you would do chown -R :accounts /path/to/directory as root. This would change ownership of all files and directories to the accounts group. Then you'll want to set the permissions so that anyone in group account has read write access. So as root, you would do chmod -R g+rw /path/to/directory.

nadroj 06-29-2006 03:27 PM

use the 'chgrp' command to change file group ownership, with the -R option to change ownership to all subdirectories and their contents. ie:
Code:

chgrp -R accounts /.../Documents/
also use the 'chmod' command to change file access modes. use the '-R' option as well. to give all access to the group and remove access to all other users, a command like this should work:
Code:

chmod -R a-rwx g+rwx
if thats what you want.. otherwise let us know

Hardip 07-02-2006 11:48 PM

Inheriting file & folder permissions.
 
Thanks a pile. The permissions have been set as I need them, however whenever I open any excel or word file from my Documents folder on the Linux box, I always opens as a 'read only' file, altought I have set the permissions of the accounts group as read & write. Why is this ??. Is there a setup problem with my samba service ??

nadroj 07-02-2006 11:56 PM

i didnt know samba was involved.. is it on a partition that is mounted read only? or on an ntfs partition? in which case you wouldnt want to write to it in linux


All times are GMT -5. The time now is 02:18 PM.