[NTLUG:Discuss] Force permissions on a directory?

Fred James fredjame at fredjame.cnc.net
Sun May 29 22:00:24 CDT 2005


Neil Aggarwal wrote:

>Hello:
>
>On my web server, I have a directory public_html in my
>home directory.  I have the public_html and all files
>in it set to mode 755.
>
>When I upload files using SFTP, they do not have mode 755
>and the web server gives me permission denied until I 
>go to the shell and change them to mode 755.
>
>Is there any want to force a directory to have all its
>files always be mode 755?
>
>Thanks,
>	Neil
>
>  
>
Neil Aggarwal
I may be wrong, but isn't that a function of the 'umask' of the user you 
log on as?

Failing that, 'sftp' has a 'chmod' command which you could use (see below).
Regards
Fred James

 From 'man sftp' on Mandrake/Mandriva 9.1:
<snip>
     chmod mode path
             Change permissions of file path to mode.
</snip>




More information about the Discuss mailing list