LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Permission issue (https://www.linuxquestions.org/questions/linux-general-1/permission-issue-840116/)

linson_85 10-24-2010 06:47 AM

Permission issue
 
Hi there

Can someone please let me know how to set default file permission to 777.
Here is my situation.I have a dir /var/www/TEST folder whose permission is

drwxr-xr-x 2 fruss psacln 4096 Oct 24 07:39 TEST/

So whenever i tried to upload file as user fruss using FTP under folder TEST,file permission should be 777 instead of 644

How can this be achieved.Once possible solution i found that changing umask value in FTP server's configuration file.I'm using proFTP server.I have changed the umask value to 000 and So uploaded folder permission is 777 and that of file permission is 666 as expected.But permission needed to be 777 instead of 666 for the uploaded file.

Please advise.

honeybadger 10-24-2010 07:53 AM

Hi there,
cd into the mentioned folder. If you want to change the permission of all the files use 'chmod -Rv 777 *'. This will help.

linson_85 10-24-2010 08:07 AM

Dear SilverBack

I know that will change the permission for the files to 777.I think it is for the existing file.What if when i create a new file under the folder TEST?. Do you think that newly created file will be having the same 777 permission as well ?.

Please advise me if I'm wrong.

Thank you for your response.

eSelix 10-24-2010 09:30 AM

From manual of ProFTP:
Quote:

Proftpd will not create files that have the execution bit turned on, this is a security driven design decision. The permissions of the uploaded file can be changed by issuing a SITE CHMOD command can be used to change the mode of the uploaded file. Syntax of the command is: SITE CHMOD <mode> <file>.
So, it can't. But in Linux you can anything. I see 2 solutions:

1. Recompile ProFTP, that it allow of creating files with execution bit set (somewhere should be 'open' function, just need set proper flags).
2. Use inotify (it can be used even in shell scripts) to automatically change file permission after creating it.


All times are GMT -5. The time now is 07:46 PM.