LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   keep chmod on folder, sub-folder and files (https://www.linuxquestions.org/questions/linux-newbie-8/keep-chmod-on-folder-sub-folder-and-files-842121/)

Friis 11-03-2010 09:37 AM

keep chmod on folder, sub-folder and files
 
I got a folder that I transfer stuff to all the time.
the folder is in chmod 775 but when i upload folders and files, they are given chmod 700, but i want it chmod 775 everytime i upload something.

so far i have logged in to my linux computer and did a chmod -R 775 to the folder every time i uploaded something to it.

is there a function somewhere to make it 775 everytime i upload or can i have something run a script, so i don't have to go in and write it everytime i upload something?

pljvaldez 11-03-2010 10:52 AM

I think you need a combination of setgid and acl's.

http://www.linuxquestions.org/questi...folder-605129/
http://www.vanemery.com/Linux/ACL/linux-acl.html#using

module0000 11-03-2010 10:55 AM

Quote:

I got a folder that I transfer stuff to all the time.
the folder is in chmod 775 but when i upload folders and files, they are given chmod 700, but i want it chmod 775 everytime i upload something.
This is your umask, it sets default permissions on new files. Check your ~/.bashrc or /etc/profile for what your default umask is being set to. If you are using FTP to transfer these files, check your FTP daemons config file for the effective umask value.

Here is the man page excerpt for umask:

Code:

umask [-p] [-S] [mode]
              The user file-creation mask is set to mode.  If  mode
              begins  with  a  digit,  it is interpreted as an octal
              number; otherwise it is interpreted as a symbolic mode
              mask similar to that accepted by chmod(1).  If mode is
              omitted, the current value of  the  mask  is  printed.
              The  -S  option  causes the mask to be printed in sym-
              bolic form; the default output is an octal number.  If
              the  -p  option  is supplied, and mode is omitted, the
              output is in a form that may be reused as input.  The
              return  status  is  0  if  the  mode  was successfully
              changed or if no mode argument was supplied, and false
              otherwise.



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