homerun
08-27-2009, 11:28 AM
I am trying to properly set file and folder permissions on my data partition, so that I can download files with Firefox, as well as create documents with notes detailing my Linux discoveries with gedit, etc. I want this to work from numerous multiboot linux distros to the same data partition.
I already have numerous files and folders in the data partition, and I am trying to change the setgid of each directory so that all new files and folders created in the directories will have "users" as the group ownership. The following command works for me except that it also changes the setgid of the "." file in each directory:
Note the permissions on the first line after the two ls -la commands:
ls -la
drwxr-xr-x 13 root users 4096 Aug 27 08:12 .
drwxr-xr-x 8 root users 4096 Aug 27 08:12 ..
drwxrwxr-x 3 root users 4096 Aug 26 12:05 Suse
find -type d -ok chmod g+s {} \;
< chmod ... . > ? y
< chmod ... ./Suse > ? y
ls -la
drwxr-sr-x 13 root users 4096 Aug 27 08:12 .
drwxr-xr-x 8 root users 4096 Aug 27 08:12 ..
drwxrwsr-x 3 root users 4096 Aug 26 12:05 Suse
chgrp -R users *
umask 002
I'd rather use "find -type d -exec chmod g+s {} \;"
I am not sure of the consequences of leaving the "." file with drwxr-sr-x permissions. As I write this I now wonder if perhaps this is what it should be!
I looked for an exclusion (-e option) such as -e -type "?", but couldn't find what I needed. I wouldn't have even noticed if not for the results from the find command's "ok" opton.
< chmod ... . > ? y or
< chmod ... . > ? n
Thanks.
I already have numerous files and folders in the data partition, and I am trying to change the setgid of each directory so that all new files and folders created in the directories will have "users" as the group ownership. The following command works for me except that it also changes the setgid of the "." file in each directory:
Note the permissions on the first line after the two ls -la commands:
ls -la
drwxr-xr-x 13 root users 4096 Aug 27 08:12 .
drwxr-xr-x 8 root users 4096 Aug 27 08:12 ..
drwxrwxr-x 3 root users 4096 Aug 26 12:05 Suse
find -type d -ok chmod g+s {} \;
< chmod ... . > ? y
< chmod ... ./Suse > ? y
ls -la
drwxr-sr-x 13 root users 4096 Aug 27 08:12 .
drwxr-xr-x 8 root users 4096 Aug 27 08:12 ..
drwxrwsr-x 3 root users 4096 Aug 26 12:05 Suse
chgrp -R users *
umask 002
I'd rather use "find -type d -exec chmod g+s {} \;"
I am not sure of the consequences of leaving the "." file with drwxr-sr-x permissions. As I write this I now wonder if perhaps this is what it should be!
I looked for an exclusion (-e option) such as -e -type "?", but couldn't find what I needed. I wouldn't have even noticed if not for the results from the find command's "ok" opton.
< chmod ... . > ? y or
< chmod ... . > ? n
Thanks.