Hi, I need some help!
I’ve got a folder in my apache directory (/srv/www/htdocs/(name)/) that I often FTP files and folders to. I actually publish programs from Visual Studio via FTP, and other people can download them.
Anyway, here’s the problem/question. Every time I upload a new file or directory, or update a file, I have to SSH my server and "chmod 777 " everything I uploaded. This gets very annoying sometimes, because by the end of my work, I might have done that command 50 times. **I would like to change to default permissions of a directory so that new files are readable, writable, and executable by all users.
** Note that I only want this to apply to the directory (/srv/www/htdocs/(name)/)
Are you saying you have changed the folder permissions with chmod?
It is possible to use the super user K file browser, right click - properties - and set permissions and there is a check box to apply to all sub-folders and their contents
Well, 777 is overkill. You only need world read permission on files that you publish. 644 will do. 777 would allow any person on the machine and anyone who can FTP in to overwrite the file and thus deface the site. Maybe that’s only you now, but later on you may have more users.
What FTP server are you using? You can configure the default permissions on uploaded files.
On Tue January 13 2009 11:46 pm, computmaxer wrote:
>
> Hi, I need some help!
> I’ve got a folder in my apache directory (/srv/www/htdocs/(name)/) that
> I often FTP files and folders to. I actually publish programs from
> Visual Studio via FTP, and other people can download them.
> Anyway, here’s the problem/question. Every time I upload a new file or
> directory, or update a file, I have to SSH my server and "chmod 777 "
> everything I uploaded. This gets very annoying sometimes, because by the
> end of my work, I might have done that command 50 times. *I would like
> to change to default permissions of a directory so that new files are
> readable, writable, and executable by all users.
> * Note that I only want this to apply to the directory
> (/srv/www/htdocs/(name)/)
>
> Any help is much appreciated!
> Thanks a lot!
>
>
computmaxer;
See if the SGID bit and Sticky bit will help in your case. As far as I know
changing the ugo permissions on directory will not alter individual files.
The SGID allows the files to inherit the same group permissions as the
directory. The sticky bit keeps others (not owner or superuser) from
deleting the files.
P. V.
“We’re all in this together, I’m pulling for you.” Red Green
> On Tue January 13 2009 11:46 pm, computmaxer wrote:
>
>>
>> Hi, I need some help!
>> I’ve got a folder in my apache directory (/srv/www/htdocs/(name)/) that
>> I often FTP files and folders to. I actually publish programs from
>> Visual Studio via FTP, and other people can download them.
>> Anyway, here’s the problem/question. Every time I upload a new file or
>> directory, or update a file, I have to SSH my server and "chmod 777 "
>> everything I uploaded. This gets very annoying sometimes, because by the
>> end of my work, I might have done that command 50 times. *I would like
>> to change to default permissions of a directory so that new files are
>> readable, writable, and executable by all users.
>> * Note that I only want this to apply to the directory
>> (/srv/www/htdocs/(name)/)
>>
>> Any help is much appreciated!
>> Thanks a lot!
>>
>>
> computmaxer;
>
> See if the SGID bit and Sticky bit will help in your case. As far as I know
> changing the ugo permissions on directory will not alter individual files.
> The SGID allows the files to inherit the same group permissions as the
> directory. The sticky bit keeps others (not owner or superuser) from
> deleting the files.
No edit from nntp,
gives the setting you want, local_umask=022, which removes only group and world write permission from uploaded files. Presumably the default was more restrictive.
You don’t really need to give execute permission since at no time are the files executed by the webserver but it doesn’t hurt anything.